You want to use single quotes:
if(c=='\0')
Double quotes (“) are for strings, which are sequences of characters. Single quotes (‘) are for individual characters.
However, the end-of-line is represented by the newline character, which is ‘\n’.
Note that in both cases, the backslash is not part of the character, but just a way you represent special characters. Using backslashes you can represent various unprintable characters and also characters which would otherwise confuse the compiler.
Related Posts:
- C++ string to double conversion
- C++ string to double conversion
- What is use of c_str function In c++
- Fastest way to check if a file exist using standard C++/C++11,14,17/C?
- Fastest way to check if a file exist using standard C++/C++11,14,17/C?
- How can I get the list of files in a directory using C or C++?
- How can I get the list of files in a directory using C or C++?
- What is a segmentation fault?
- How many spaces for tab character(\t)?
- What does (~0L) mean?
- What is the effect of extern “C” in C++?
- What exactly is the difference between “pass by reference” in C and in C++?
- When to use extern “C” in simple words? [duplicate]
- What is `CString`?
- Floating point exception( core dump
- Mutex example / tutorial? [closed]
- What does “dereferencing” a pointer mean?
- What is an unsigned char?
- What does “dereferencing” a pointer mean?
- Convert char to int in C and C++
- Why use conio.h?
- How to convert a char array to a string?
- How to track down a “double free or corruption” error
- Convert an int to ASCII character
- Split a string using C++11
- How to track down a “double free or corruption” error
- How do I iterate over the words of a string?
- How to go from fopen to fopen_s
- Returning an empty string : efficient way in c++
- Difference between long double and double in C and C++ [duplicate]
- What is the difference between const int*, const int * const, and int const *?
- How to print pthread_t
- What is the printf format specifier for bool?
- Why am I getting string does not name a type Error?
- C++ deprecated conversion from string constant to ‘char*’
- identifier “string” undefined?
- Convert Python program to C/C++ code?
- Converting a vector
to string - How can I convert const char* to string and then back to char*?
- std::string formatting like sprintf
- Sorting Characters Of A C++ String
- basic_string::_M_construct null not valid after constructing subvector of strings
- Is “argv[0] = name-of-executable” an accepted standard or just a common convention?
- How to return a string from a C++ function?
- std::out_of_range error?
- What is the difference between isdigit() and isnumber()?
- Convert char* to string C++
- printf with std::string?
- How to convert C++ Code to C
- C++ String Variable Declaration
- warning: control reaches end of non-void function [-Wreturn-type]
- gcc/g++: “No such file or directory”
- What does ‘const static’ mean in C and C++?
- c++ convert string to hex
- How can I iterate through a string and also know the index (current position)?
- c++ parse int from string [duplicate]
- C++ array assign error: invalid array assignment
- How to run valgrind with basic c example?
- Typedef function pointer?
- “…redeclared as different kind of symbol”?
- Debug vs Release in CMake
- What does “Permission denied” “Id returned 1 exit status” mean?
- std::cin input with spaces?
- Multi-character constant warnings
- What is the C equivalent to the C++ cin statement?
- c++ Read from .csv file
- Static linking vs dynamic linking
- How to alphabetically sort strings?
- Is there a replacement for unistd.h for Windows (Visual C)?
- C++ – include unistd.h: why not cunistd?
- Dynamically allocated string array, then change it’s value?
- How to project a point onto a plane in 3D?
- C: using strtol endptr is never NULL, cannot check if value is integer only?
- Why use pointers?
- Why I cannot cout a string?
- How to print a string in C++
- What’s the difference between * and & in C?
- How do I create a random alpha-numeric string in C++?
- Difference between pic Vs pie
- Double pointer array in c++
- What’s the meaning of exception code “EXC_I386_GPFLT”?
- error: switch quantity not an integer
- How to write log base(2) in c/c++
- Reading a string from file c++
- How to change string into QString?
- Remove last character from C++ string
- gcc -g :what will happen
- Converting String to Cstring in C++
- Is there a standard sign function (signum, sgn) in C/C++?
- Function stoi not declared
- Warning: comparison of distinct pointer types
- cc1.exe System Error – libwinpthread-1.dll missing – But it isn’t
- Two decimal places using printf( )
- ‘setprecision’ is not a member of ‘std’
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- Is there a way to compile C++ to C Code?
- enum to string in modern C++11 / C++14 / C++17 and future C++20
- Converting bool to text in C++
- Declaration is incompatible with type
- I’m getting the error “stoi is not a member of std” in myprogramminglab [duplicate]