string + char c++ code example

Example 1: c++ declare char

// syntax: 
// char <variable-name>[] = "<string/char-you-want-to-store>"; 

// example (to store 'Hello!' in the YourVar variable): 
char YourVar[] = "Hello!";

Example 2: c++ string

#include <string>

std::string myString = "Hello, World!";

Example 3: char c++

isdigit() - Check if character is decimal digit 
isalpha() - Check if character is alphabetic
isblank() - Check if character is blank
islower() - Check if character is lowercase letter
isupper() - Check if character is uppercase letter
isalnum() - Check if character is alphanumeric

Example 4: working with char and string c++

String and Char

Tags:

C Example