Category: C plus plus Tutorials

C plus plus code to Print Character using ASCII value

C-plus-plus-code-print-character-from-ascii-value-output

This article provides C plus plus source code to print character using ASCII value. It gets the ASCII value input from user and prints the corresponding character. C++ Source code to print character from ASCII value #include <iostream> using namespace std; int main() { int asciiValue; //Input the ASCII value cout << “Enter ASCII value: […]

Print ASCII value of a character [C Plus Plus]

print-ASCII-value-of-character-CPP

Below is the source code to print ASCII value of a character entered by the user. CPP source code to print a character’s ASCII value #include <iostream> using namespace std; int main() { char character; //Input the character cout << “Type a character and hit ENTER: “; // Read the character cin >> character; // […]

C plus plus code to remove special characters from a string [C++]

cpp-code-output-to-remove-special-characters-from-string

Below is the C plus plus source code to remove special characters other than alphabets (excluding upper and lower case letters). // C++ source code to remove special characters other than alphabets from a string #include <iostream> using namespace std; int main() { string str; cout << “Enter a string with special characters: “; // […]

C plus plus code to Extract/Replace String between two delimiters

cpp-code-output-for-extracting-string-between-two-delimiters

This article shows the C plus plus (C++) code to extract/replace a sub-string between two delimiters or characters using find and substr functions. Extract String between two delimiters For example, if you want to extract the string between two delimiters “[” and “]” from Sri[nivas]an , then the CPP code will be #include <iostream> using […]

Function to copy files in C++

C++ function to copy a file to another. Explained with it’s syntax, parameters, return value and an example Syntax Syntax of C++ function to copy file is BOOL CopyFile(LPCTSTR ExistingFileName, LPCTSTR NewFileName, BOOL bFailIfExists); Parameters ExistingFileNameEnter the existing file path which is to be copied NewFileNameEnter the new file path. This is the file where […]