Skip to main content

Posts

Showing posts from September, 2020

Strings

In this article, you'll learn to handle strings in C. You'll learn to declare them, initialize them and use them for various input/output operations. String is a collection of characters. There are two types of strings commonly used in C++ programming language: Strings that are objects of string class (The Standard C++ Library string class) C-strings (C-style Strings) C-strings In C programming, the collection of characters is stored in the form of arrays, this is also supported in C++ programming. Hence it's called C-strings. C-strings are arrays of type char terminated with null character, that is, \0 (ASCII value of null character is 0). How to define a C-string? char str[] = "C++"; In the above code, str is a string and it holds...