Re: [algogeeks] Re: o/p

2011-08-07 Thread sagar pareek
thats what i thought On Mon, Aug 8, 2011 at 12:18 AM, Kamakshii Aggarwal wrote: > fun(&p) hona tha.. > but i wrote(*p) > > > On Mon, Aug 8, 2011 at 12:17 AM, aseem garg wrote: > >> What was the mistake? >> Aseem >> >> >> >> On Mon, Aug 8, 2011 at 12:15 AM, Kamakshii Aggarwal < >> kamakshi...@gma

Re: [algogeeks] Re: o/p

2011-08-07 Thread Kamakshii Aggarwal
fun(&p) hona tha.. but i wrote(*p) On Mon, Aug 8, 2011 at 12:17 AM, aseem garg wrote: > What was the mistake? > Aseem > > > > On Mon, Aug 8, 2011 at 12:15 AM, Kamakshii Aggarwal > wrote: > >> i got my mistake...sorry guys >> >> >> On Mon, Aug 8, 2011 at 12:14 AM, Kamakshii Aggarwal < >> kamaks

Re: [algogeeks] Re: o/p

2011-08-07 Thread aseem garg
What was the mistake? Aseem On Mon, Aug 8, 2011 at 12:15 AM, Kamakshii Aggarwal wrote: > i got my mistake...sorry guys > > > On Mon, Aug 8, 2011 at 12:14 AM, Kamakshii Aggarwal > wrote: > >> what is the problem with the following code >> >> void fun(int **p) >> { >> static int q = 10; >> >>

[algogeeks] Re: o/p

2011-08-07 Thread Kamakshii Aggarwal
i got my mistake...sorry guys On Mon, Aug 8, 2011 at 12:14 AM, Kamakshii Aggarwal wrote: > what is the problem with the following code > > void fun(int **p) > { > static int q = 10; > > *p = &q; > } > > int main() > { > int r = 20; > int *p = &r; > fun(*p); > > printf("%d", *p); > g

Re: [algogeeks] Re: o/p

2011-02-07 Thread tech rascal
no, its GNU gcc compiler On Mon, Feb 7, 2011 at 10:27 PM, jalaj jaiswal wrote: > this error will be given by g++ compiler , i guess.. i also got d same > > On Mon, Feb 7, 2011 at 10:20 PM, tech rascal wrote: > >> but gcc compiler is giving error saying- can't convert int* to char* in >> assignme

Re: [algogeeks] Re: o/p

2011-02-07 Thread jalaj jaiswal
this error will be given by g++ compiler , i guess.. i also got d same On Mon, Feb 7, 2011 at 10:20 PM, tech rascal wrote: > but gcc compiler is giving error saying- can't convert int* to char* in > assignment..so hw r u getting 566 as answer?? > ( I am using codeblocks on ubuntu ) > > > On

Re: [algogeeks] Re: o/p

2011-02-07 Thread tech rascal
but gcc compiler is giving error saying- can't convert int* to char* in assignment..so hw r u getting 566 as answer?? ( I am using codeblocks on ubuntu ) On Mon, Feb 7, 2011 at 10:10 PM, jalaj jaiswal wrote: > @ dave .. you r correct :) > > > On Mon, Feb 7, 2011 at 9:41 PM, Dave wrote: > >>

Re: [algogeeks] Re: o/p

2011-02-07 Thread jalaj jaiswal
@ dave .. you r correct :) On Mon, Feb 7, 2011 at 9:41 PM, Dave wrote: > @Jalaj: The results depend on the "endianness" of the addressing > scheme on your hardware. (See http://en.wikipedia.org/wiki/Endianness.) > The language standard does not specify a required endianness. You must > be using

[algogeeks] Re: o/p

2011-02-07 Thread Dave
@Jalaj: The results depend on the "endianness" of the addressing scheme on your hardware. (See http://en.wikipedia.org/wiki/Endianness.) The language standard does not specify a required endianness. You must be using a little-endian hardware, but the results would be different on a big-endian syste

Re: [algogeeks] Re: o/p

2011-02-07 Thread rahul rai
For more of these tricks one can see the first 10 lectures from{exclude 1st one} http://see.stanford.edu/see/lecturelist.aspx?coll=2d712634-2bf1-4b55-9a3a-ca9d470755ee On 2/7/11, ranjane wrote: > thank u jalaj > > On Feb 6, 10:03 pm, jalaj jaiswal wrote: >> the logic is :- >> int is stored in 32

[algogeeks] Re: o/p

2011-02-06 Thread ranjane
thank u jalaj On Feb 6, 10:03 pm, jalaj jaiswal wrote: > the logic is :- > int is stored in 32 bits in our systems > > 300 is 0001 00101100 > as ptr is character pointer, it points to lower 8 bits > and when *++ptr=2 gets executed then 0001 changes to 0010(equal to >

Re: [algogeeks] Re: o/p

2010-06-05 Thread Rohit Saraf
oh... why did u put %u. i did not even notice that :P -- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and Engineering IIT Bombay http://www.cse.iitb.ac.in/~rohitfeb14 -- You received this message because you are subs

[algogeeks] Re: o/p

2010-06-05 Thread Devendra Pratap Singh
reason for that o/p is ... coz range of short int is -32768 to 32767 and value of i start with i=0 and each time it will increment by 1 so corresponding value of i will be 1 2 3 . . . 32766 32767 -32768 -32767 . . . . -2 -1 but coz in printf u r using %u so it will print... 1 2 3 . . . 3