Answer the question
In order to leave comments, you need to log in
How to make a text entry?
#include
using namespace std;
int main()
{
string s;
cin>>s;
system("PAUSE");
return 0;
}
It is necessary to make it so that with each change in s, the value is written to the textbox, erasing the previous value
Answer the question
In order to leave comments, you need to log in
it is possible like this:
#include <iostream>
#include <fstream>
#include <string>
using std::cin;
using std::string;
int main(){
setlocale(LC_ALL,"Russian");
string str;
while(cin >> str)//While Ctrl-Z (Ctrl-D *nix)
{
std::ofstream exp("text.txt");
exp << str << std::endl;
}
}
To do this, you need to "reset" the old value.
Approximately as follows:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for (i=0;i<3;i++)
{
char str[10]="";
printf("first print %s\n",str);
scanf("%s",str);
printf("second print %s\n",str);
}
return 0;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question