I am trying to take array of string as a input but its giving run time error
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
string str[500];
int n;
cin>>n;
for(int i=0;i<n;i++)
scanf("%s",&str[i]); \\works fine with cin but gives error using scanf
return 0;
}
Process terminated with status -1073741510 (0 minute(s), 10 second(s))
works fine with
cinbut give error if i usescanfCan some one tell me why its giving such error
what does that error mean and why doesn't it gives error while using
cinI am using code blocks 13.12
Aucun commentaire:
Enregistrer un commentaire