Dec 11, 2011 #1 S saad Member Joined Feb 25, 2008 Messages 51 Reaction score 0 Points 6 greeting[]="Hello.", what is the effect of? statement puts(++greeting)?
Dec 12, 2011 #2 M mackey Member Joined Apr 23, 2010 Messages 35 Reaction score 0 Points 6 When greeting is declared as a character pointer, puts(++greeting) will output “ello”. When it is declared as a static char array, the puts(++greeting) should generate a compile time error.
When greeting is declared as a character pointer, puts(++greeting) will output “ello”. When it is declared as a static char array, the puts(++greeting) should generate a compile time error.
Dec 12, 2011 #3 G geli New member Joined Oct 14, 2008 Messages 3 Reaction score 0 Points 1 #include <stdio.h> int main(void) { char *greetptr = "Hello." char greet[] = "Hello." puts(++greetptr); puts(++greet); return 0; } Compile and run, what do you see on screen, what happened?
#include <stdio.h> int main(void) { char *greetptr = "Hello." char greet[] = "Hello." puts(++greetptr); puts(++greet); return 0; } Compile and run, what do you see on screen, what happened?