Hi all,
I got a problem with this question:
Read the string "hello" include the NULL character in the end of string.
How can I do it ?
widapol 0 Newbie Poster
Recommended Answers
Jump to PostThe NULL character is '\0', or just simply 0. Use while loop to check each character in the string.
Jump to Post>>Read the string "hello" include the NULL character in the end of string.
What exactly does that mean? Read it from where?
Jump to PostRead it from the keyboard, a data file, socket stream, or what?
From a data file. ifstream will put the null terminating character at the end for you. You don't have to do anything with that.#include <fstream> #include <iostream> using std::ifstream; using std::cout; int main() { …
All 12 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
widapol 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
widapol 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
creeps 74 Junior Poster in Training
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
widapol 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
creeps 74 Junior Poster in Training
widapol 0 Newbie Poster
zark_yoc 0 Newbie Poster
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.