andynov123
08-31-2011, 12:37 AM
I'm getting errors and its not compiling can someone please let me know what is wrong with my code. I'm trying to have the name you enter appear on the screen 100 times.
Heres my code
#include <iostream>
#include <stdio.h>
int main(){
int x;
char name[20];
printf("Please Enter Your Name:");
for (x=0;x<100;x++){
scanf("%s", &name);
printf("Your Name is %s", name);
}
system ("pause");
}
And heres an image with the errors
http://imageshack.us/f/849/picor.png/
and if I do what the error says add StdAfx.h I just get another error saying it cant open source file StdAfx.h
Heres my code
#include <iostream>
#include <stdio.h>
int main(){
int x;
char name[20];
printf("Please Enter Your Name:");
for (x=0;x<100;x++){
scanf("%s", &name);
printf("Your Name is %s", name);
}
system ("pause");
}
And heres an image with the errors
http://imageshack.us/f/849/picor.png/
and if I do what the error says add StdAfx.h I just get another error saying it cant open source file StdAfx.h