int main()
{
char array[100];
char *ptr;
ptr = &array[0];
int i, j;
fgets(ptr, 100, stdin);
printf("%s", array);
getch();
return 0;
Type: Posts; User: johnjrgs
int main()
{
char array[100];
char *ptr;
ptr = &array[0];
int i, j;
fgets(ptr, 100, stdin);
printf("%s", array);
getch();
return 0;
How do I use getchar and pointers at the same time?
I still am not sure what to do here though.. any ideas?
Thanks adak, I declared a ptr to the array I'm using atm. Not sure what to do after that though.
May I ask where is the data after the...
I think I need to use
while(input[0]!='\n'){
scanf("%s", input)
printf("%s", pointerhere);
}
basically we were asked to make a program that will print everything before the user hits...