hi alll,,
i want to read a text file character wise and write to buffer till the occurance of first space... can any1 giv me a sample code snippet plzz

Member Avatar for jencas

Just read from an ifstream with operator >> to a std::string and you get each word of the text file in your std::string one by one

std::string str;
std::ifstream file("textfile.txt");
while(file >> str))
{
  // ... perform any action on word in 'str'
}
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.