#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string *words;
int x,ctr;
words=new string [x];
cout<<"Enter number of words to input: ";
cin>>x;
for(ctr=0;ctr<x;ctr++)
{
cout<<"Enter word number "<< (ctr+1)<<" : ";
cin>>words[ctr];
}
system("PAUSE");
return 0;
}
Hi!,can you please help me guys on how to save those string that I input in notepad. I have no idea what codes to use, any help or links will do!
I have no idea what you mean by "save those string that I input in notepad".
But you have an error in your code there, in line 9
words= new string [x];
You use x even though you never assigned a value to it. Just put that line after cin>>x.
For that "save to notepad" thing- sounds as if you were trying to write a textfile (notepad is a program for displaying text files... you can't save something to a program).