[algogeeks] c-aps

2011-08-01 Thread Radhika Renganathan
HI, I'm seeking for a source for learning c-aps and i don get any valuable
ones. Can anyone plz suggest me or share the valuable sources u know. Thank
u in anticipation

-- 
 radhika .. :)

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] C aps sources plz

2011-07-24 Thread ~*~VICKY~*~
Hi all, as i find it hard to find a site that has a collection of non
obvious or fairly hard  c aps sites anywhere, i seek help here. plz post if
u find any source proving to be useful.


-- 
Cheers,

  Vicky

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread Amol Sharma
it's not defined in the standard.unpredictable behaviour !!
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad




On Mon, Jul 18, 2011 at 2:36 PM, keyan karthi keyankarthi1...@gmail.comwrote:

 #includeiostream
 using namespace std;

 int main()
 {
 int p=1;
 printf(%d %d %d %d,++p,p++,p++,++p);
 }

 output :  5 3 2 5

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread Boobal Subramaniyam
sequence points...

On Mon, Jul 18, 2011 at 3:11 PM, Amol Sharma amolsharm...@gmail.com wrote:

 it's not defined in the standard.unpredictable behaviour !!
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Mon, Jul 18, 2011 at 2:36 PM, keyan karthi 
 keyankarthi1...@gmail.comwrote:

 #includeiostream
 using namespace std;

 int main()
 {
 int p=1;
 printf(%d %d %d %d,++p,p++,p++,++p);
 }

 output :  5 3 2 5

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

with pleasure
boobal

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread keyan karthi
@boobal
can u pls elaborate on sequence points
@atul
i compiled this in ubuntu

On Mon, Jul 18, 2011 at 3:13 PM, Boobal Subramaniyam booban...@gmail.comwrote:

 sequence points...


 On Mon, Jul 18, 2011 at 3:11 PM, Amol Sharma amolsharm...@gmail.comwrote:

 it's not defined in the standard.unpredictable behaviour !!
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Mon, Jul 18, 2011 at 2:36 PM, keyan karthi 
 keyankarthi1...@gmail.comwrote:

 #includeiostream
 using namespace std;

 int main()
 {
 int p=1;
 printf(%d %d %d %d,++p,p++,p++,++p);
 }

 output :  5 3 2 5

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 with pleasure
 boobal

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread sagar pareek
@keyan
i examined many times in ubuntu that it delays the o/p of pre-increment
:)
but in dev C++ o/p is as given by atul

On Mon, Jul 18, 2011 at 3:15 PM, keyan karthi keyankarthi1...@gmail.comwrote:

 @boobal
 can u pls elaborate on sequence points
 @atul
 i compiled this in ubuntu


 On Mon, Jul 18, 2011 at 3:13 PM, Boobal Subramaniyam 
 booban...@gmail.comwrote:

 sequence points...


 On Mon, Jul 18, 2011 at 3:11 PM, Amol Sharma amolsharm...@gmail.comwrote:

 it's not defined in the standard.unpredictable behaviour !!
 --


 Amol Sharma
 Third Year Student
 Computer Science and Engineering
 MNNIT Allahabad




 On Mon, Jul 18, 2011 at 2:36 PM, keyan karthi keyankarthi1...@gmail.com
  wrote:

 #includeiostream
 using namespace std;

 int main()
 {
 int p=1;
 printf(%d %d %d %d,++p,p++,p++,++p);
 }

 output :  5 3 2 5

 --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 with pleasure
 boobal

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread schrodinger
AFAIK, official answer is due to undefined behavior.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/EAWuaDE1CIcJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread keyan karthi
thanks ppl :)

On Mon, Jul 18, 2011 at 3:59 PM, schrodinger 6fae1ce6347...@gmail.comwrote:

 AFAIK, official answer is due to undefined behavior.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/EAWuaDE1CIcJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps can some one explain this pls :)

2011-07-18 Thread DIPANKAR DUTTA
This depends on how the compiler evaluates the actual parameters and
push to the stack when printf is called.
this is totally depeding on the compiler architecture [ basically
implemetion of activation record in intermediate code genaration
phase, read intermidiate language and virtual machine @ compiler
design by Aho ullman]

In dev C++, the printf works as below:
they evalute expression from right to left and push back into stack.
thus the expression printf(%d %d %d %d,++p,p++,p++,++p); evaluted as below:

initially p=1;
printf(%d %d %d %d,++p,p++,p++,2);//p=2 as prefix
printf(%d %d %d %d,++p,p++,2,2);//p=3 as postfix
printf(%d %d %d %d,++p,3,2,2);//p=4 again postfix

printf(%d %d %d %d,5,3,2,2);//p=5 here prefix..

as now our stack contaion 5,3,2,2 ..it print's as this...

some more example as :

printf(%d %d %d %d %d,++ p,p++,p++,++p, p++); output:6 4 3 3 1
printf(%d %d %d %d %d,++ p,p++,p++,p++, p++); output: 6,4,3,2,1
printf(%d %d %d %d %d,++p,p--,--p,p++, p--); output: 0 0 0 0 1


On 7/18/11, keyan karthi keyankarthi1...@gmail.com wrote:
 thanks ppl :)

 On Mon, Jul 18, 2011 at 3:59 PM, schrodinger
 6fae1ce6347...@gmail.comwrote:

 AFAIK, official answer is due to undefined behavior.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/EAWuaDE1CIcJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Thanks and Regards,
--
**DIPANKAR DUTTA
Software Development Engineer
Xen Server - OpenStack Development Team (DataCenter and Cloud)

Citrix RD India Pvt Ltd
69/3, Millers Road, Bangalore – 560052
Phone: +91 9045809987
Office: Extn: 16429
Email: dipankar.du...@citrix.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] C aps output

2011-05-20 Thread siva viknesh
main()
{
int i = 257;
int *iPtr = i;
printf(%d %d, *((char*)iPtr), *((char*)iPtr+1) );
}
Answer:
1 1


main()
{
int i = 258;
int *iPtr = i;
printf(%d %d, *((char*)iPtr), *((char*)iPtr+1) );
}
Answer:
2 1



..can anybody explain how??
-- 
Regards,
$iva

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] c aps ..output discrepancy !!!

2011-05-20 Thread siva viknesh
hi

#includestdio.h
main()
{
int a=2,*f1,*f2;
f1=f2=a;
*f2+=*f2+=a+=2.5;
printf(\n%d %d %d,a,*f1,*f2);
}



for this code in code blocks IDE got 8 8 8 as op

 in http://ideone.com/ok850 got 12 12 12

   in 175 c aps pdf it has been given as 16 16 16 as
output 

so this code also has something to do with SEQUENCE POINTS 

is sequence points applicable for pointers too ??

the output varies based on compiler or underlying machine architecture

can anybody give clear picture about sequence points and whats happening in
this code...thanks in advance :)

-- 
Regards,
$iva

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] C aps output

2011-05-20 Thread Alin Rus
On Fri, May 20, 2011 at 3:19 PM, siva viknesh sivavikne...@gmail.com wrote:

 main()
 {
 int i = 257;
 int *iPtr = i;
 printf(%d %d, *((char*)iPtr), *((char*)iPtr+1) );
 }
 Answer:
 1 1


i = 10001

first case *((char *)iPtr) cast to char 8 bits, discard first bit
0001  == 1
second *((char *)iPtr+1) cast to char 8bit address of pointer of type
char (8 bits) + 1 (next 8 bits) == 1


[ 0001]   [ 0001] = 257
*((char *)iPtr+1)*((char *)iPtr



 main()
 {
 int i = 258;
 int *iPtr = i;
 printf(%d %d, *((char*)iPtr), *((char*)iPtr+1) );
 }
 Answer:
 2 1


same as above.



 ..can anybody explain how??
 --
 Regards,
 $iva

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Alin Rus

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] c aps

2011-01-09 Thread siva viknesh
#includestdio.h
int main()
{
int i=2;
for(printf(cat );printf(rat )i--;printf(mat ))
{

   printf(bat );

 }

}


ouput : cat rat bat mat rat bat mat rat

can anybody plz explain how we get this output??
-- 
Regards,
$iva

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] c aps

2011-01-09 Thread Prateek Jain
the printf function returns 1 when it prints a string..
for (1;1i--;1)
{
printf(bat);
}
note that i=2 has been cunningly initialized before. and the decrement of i
has been done in middle expression of the for loop
hence, actually its like
for(;i--;)
{
}

how many times will this execute? Twice.i=1 and i=2, for i=O, the middle
condition shall become O and hence fails.


therefore the ouput.

On Sun, Jan 9, 2011 at 6:48 PM, siva viknesh sivavikne...@gmail.com wrote:


 #includestdio.h
 int main()
 {
 int i=2;
 for(printf(cat );printf(rat )i--;printf(mat ))
 {

printf(bat );

  }

 }


 ouput : cat rat bat mat rat bat mat rat

 can anybody plz explain how we get this output??
 --
 Regards,
 $iva

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] C aps ques

2010-12-14 Thread vamsi achyuth
the evalution will be done from right to left in printf
statement..so ++x will be evaluted and then x++.may be the out
put is 6 and 6 i think

On 13 December 2010 22:39, siva viknesh sivavikne...@gmail.com wrote:

 #includestdio.h
 int main()
 {
  int x = 5;
  printf(%d %d, x++, ++x);

  return 0;

  }

 for this output is 6 7 ... how evaluation proceeds??

 --
 Regards,
 $iva

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] C aps ques

2010-12-13 Thread siva viknesh
#includestdio.h
int main()
{
 int x = 5;
 printf(%d %d, x++, ++x);

 return 0;

 }

for this output is 6 7 ... how evaluation proceeds??

-- 
Regards,
$iva

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.