Member Avatar for kohkohkoh

after words are been entered by the user, it saved in the file.txt as address something like 0047D123.
what should i do if i want it to be appeared as in full character??
thank you!

#include <iostream>
#include <fstream>
using namespace std;
int main()
{
 char words[50];
 char *p = words;
 ofstream file;

 file.open("file.txt");  //open a file

 file<<cin.getline(words,50,'\n');  //write to it

 file.close(); //close it
 return 0;
}

Recommended Answers

All 3 Replies

cin.getline(words,50,'\n'); //write to it
    file<<words;
Member Avatar for kohkohkoh

thank you guys
actually i went to that site already
just that don't understand a bit here and there
thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.