Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
C C-Macro & Preprocessor c-puzzle

C program to print a string without any quote (singe or double) in the program

Print a string without using quotes anywhere in the program using C or C++. Note : should not read input from the console. Recommended: Please try your approach on ...
C C++ cpp-data-types

Convert a floating point number to string in C

Write a C function ftoa() that converts a given floating point number to string. Use of standard library functions for direct conversion is not allowed. The followin...
Stack Stack

Stack Set 3 (Reverse a string using stack)

Given a string, reverse it using stack. For example “GeeksQuiz” should be converted to “ziuQskeeG”. Following is simple algorithm to reve...
Arrays C++ School Programming

Array of Strings in C++ (3 Different Ways to Create)

Array of Strings can be created in C++, which can be quite handy. There are 3 ways to create Array of Strings. Using 2D array (Both C and C++): This method is usef...
C C++ cpp-string

Counts of distinct consecutive sub-string of length two using C++ STL

Given a string the task is to print all distinct sub-strings of length two in the given string. All substrings should be printed in lexicographical order. Examples: I...
C++ cpp-string CPP

Raw string literal in C++

In C++, to escape characters like “ ” we use an extra “”. From C++ 11, we can use raw strings in which escape characters (like or &#x2...
C C++ CPP-Library

Converting string to number and vice-versa in C++

In general or more specifically in competitive programming there are many instances where we need to convert a number to a string or string to a number. But lack of k...
C C++ School Programming

Different methods to reverse a string in C/C++

Given a string, write a C/C++ program to reverse it. Write own reverse function by swapping characters: One simple solution is two write our own reverse function ...
C C++ Strings

Tokenizing a string in C++

Tokenizing a string denotes splitting a string with respect to a delimiter. There are many ways we can tokenize a string. Let’s see each of them: stringstream ...
C++ Strings cpp-string

Convert string to char array in C++

Many of us have encountered error ‘cannot covert std::string to char[] or char* data type’. Examples: Input : string s = "geeksforgeeks" ; Ou...

Subscribe to Our Newsletter