Hello, could anyone help me with C language a little. I'm trying to write a program with pointers, which would scan some words to the array of strings and would print them on a screen. I'm new to C programming, that's why it's so difficult to deal with such a simple task
[code=c]
#include <stdio.h>
#include <string.h>
int main ()
{
char* string[3];
int j;
for(j=0;j<3;j++ )
{
fgets(string[j], sizeof string[j], stdin);
}
for(j=0;j<3;j++ )
{
printf("String number %d: \"%s\"\n", j, string[j]);
}
return 0;
} [/code]
[code=c]
#include <stdio.h>
#include <string.h>
int main ()
{
char* string[3];
int j;
for(j=0;j<3;j++ )
{
fgets(string[j], sizeof string[j], stdin);
}
for(j=0;j<3;j++ )
{
printf("String number %d: \"%s\"\n", j, string[j]);
}
return 0;
} [/code]
Comment