Re: [algogeeks] can somebody kindly explain what would be the output for the following program

2011-10-06 Thread Raghav Garg
*in turbo c:
output is b
as post increment operator will increment later..*
Thanking you

*With regards-
Raghav garg
Contact no. 9013201944
www.facebook.com/rock.raghavag
B. tech (IT), 5th sem
University School Of Information Technology
Guru Govind Singh Indraprastha University
Delhi*



On Thu, Oct 6, 2011 at 10:36 PM, sunny agrawal wrote:

> Shiva is right and that is the answer
> *
> if you try to change the values in a character array literal, the behavior
> is undefined*
> so on some compilers like Turbo C u may get o/p
>
>  --
> 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] can somebody kindly explain what would be the output for the following program

2011-10-06 Thread sunny agrawal
Shiva is right and that is the answer
*
if you try to change the values in a character array literal, the behavior
is undefined*
so on some compilers like Turbo C u may get o/p

-- 
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] can somebody kindly explain what would be the output for the following program

2011-10-06 Thread gaurav yadav
output= b
try running on turbo c .

-- 
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] can somebody kindly explain what would be the output for the following program

2011-10-06 Thread shiva@Algo
check this :
https://www.securecoding.cert.org/confluence/display/seccode/STR30-C.+Do+not+attempt+to+modify+string+literals

On Thu, Oct 6, 2011 at 9:40 PM, Neha Gupta  wrote:

> its not an error
> infact pre-increment operator doesnt hv an impact in changing the value of
> const stringdats y the o/p is "a"
>
> --
> 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] can somebody kindly explain what would be the output for the following program

2011-10-06 Thread Neha Gupta
its not an error
infact pre-increment operator doesnt hv an impact in changing the value of
const stringdats y the o/p is "a"

-- 
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] can somebody kindly explain what would be the output for the following program

2011-10-06 Thread shiva@Algo
here

*char *p = "ayqm";
p points to constant character string
so ++*(p++) is an attempt to modify the string so its an error
*


On Thu, Oct 6, 2011 at 8:35 AM, praneethn  wrote:

> *int main()
>
>   {   
>
>   char *p = "ayqm";
>
>   printf("%c",++*(p++));
>   return 0;
>
>  }*
>
>  --
> 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.