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)?
- Why the switch statement cannot be applied on strings?
- What does (~0L) mean?
- How to convert string to char array in C++?
- How can I convert a std::string to int?
- Easiest way to convert int to string in C++
- What is the difference between float and double?
- std::string to char*
- How to convert string to char array in C++?
- C++ — expected primary-expression before ‘ ‘
- What is the effect of extern “C” in C++?
- Why are #ifndef and #define used in C++ header files?
- What exactly is the difference between “pass by reference” in C and in C++?
- Conversion from string to char – 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?
- How do I include the string header?
- Convert char to int in C and C++
- Why use conio.h?
- Differences between C++ string == and compare()?
- 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
- How do I convert a double into a string in C++?
- Split a string using C++11
- How to track down a “double free or corruption” error
- Why unsigned int 0xFFFFFFFF is equal to int -1?
- What is the significance of return 0 in C and C++?
- How do I iterate over the words of a string?
- How to convert an instance of std::string to lower case
- Check if a string contains a string in C++
- How to go from fopen to fopen_s
- How do I iterate over the words of a string?
- Returning an empty string : efficient way in c++
- Replace part of a string with another string
- 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 reverse an std::string? [duplicate]
- What is the C version of RMI
- How to print pthread_t
- C++ Parsing input string to variables
- What is the difference between const int*, const int * const, and int const *?
- What is the printf format specifier for bool?
- std::string to char*
- Is there a function to copy an array in C/C++?
- How to convert a std::string to const char* or char*
- Difference between using Makefile and CMake to compile the code
- How do I tokenize a string in C++?
- Why use string::iterator rather than index?
- Why am I getting string does not name a type Error?
- What is the difference between a static and const variable?
- Should I learn C before learning C++?
- Eclipse C++ : “Program “g++” not found in PATH”
- Visual Studio debugger error: Unable to start program Specified file cannot be found
- C++ deprecated conversion from string constant to ‘char*’
- identifier “string” undefined?
- unsigned int vs. size_t
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- Convert Python program to C/C++ code?
- Press Enter to Continue
- Converting a vector
to string - error: expected primary-expression before ‘)’ token (C)
- Parsing a comma-delimited std::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?
- Examples of good gotos in C or C++
- How to copy a string of std::string type in C++?
- How to return a string from a C++ function?
- What is activation record in the context of C and C++?
- std::out_of_range error?
- What is the difference between isdigit() and isnumber()?
- Convert char* to string C++
- printf with std::string?
- Convert a String In C++ To Upper Case
- Right way to split an std::string into a vector
- Read whole ASCII file into C++ std::string
- How to convert C++ Code to C
- How to make an array with a dynamic size? General usage of dynamic arrays (maybe pointers too)?
- C++: std does not have member “string”
- Right way to split an std::string into a vector
- Fatal error: ‘stdafx.h’ file not found
- string subscript out of range error
- C++ String Variable Declaration
- warning: control reaches end of non-void function [-Wreturn-type]