I dont get this'
Im practiceing with some redirections. I wrote this and it works fine in my IDE using gnu
Code:
#include <stdio.h>
#include<stdlib.h>
int main(){
int x;
char *my_string[100]={'\0'};
gets(my_string);
puts("");
printf("This came from test file %s \n\n\n\n\n",my_string);
return;
}
I put the same thing in my text editor and run it using g++ and all i get back is these rediculous compile errors
Code:
warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char **’ [-Wformat]
I dont get it
Why will it let me use that little bit of code in my ide but not off the command line
As i said i am trying ot get familiar with redirections. so im using the command line to read in a few lines of test i have stored in a .dat
fyi im on ubuntu
if that matters
Can someone please help
Is it just a warning and not an error?