-
Urgent Help needed!
Code:
#include <stdio.h>
#define MAXSTRLEN 255
main ()
{ /*main*/
char *CurCharPtr;
char String [MAXSTRLEN];
printf("Enter a line of text:"); /*write a prompt*/
fgets(String,MAXSTRLEN,stdin); /*read the line*/
/*Print a character until found
*a zero terminator is found
*/
for (CurCharPtr= &string[0]; *CurCharPtr!='\0';
CurCharPtr++)
printf("The next character is %c\n", *CurCharPtr);
}
/*main*/
How do i rewrite the above program by simplifying it using array and pointer references?
-
-
I think you are already using arrays about pointer you are still using what do u want
-
Google stringstring, string and cin. Viola, problem solved.