C++ || string with c++ || Part - 1

 Programming codester 

C++ || String with c++  

  

[PART-1] 

in previous tutorial we learn about operators. 

So now it's time to learn the concept of string with object-oriented programming with c++. 

Question of the day:

Which memory storage is widely used in PCs and Embedded Systems?
a) EEPROM
b) Flash memory
c) SRAM
d) DRAM


STRING WITH C++: - 

  • Strings are used for storing text. 
  • string variable contains a collection of characters. 
  • So, let's learn with example about string. 

Syntax: 

  • string variable = “your string”; 

EXAMPLE: 

string blog = "programming codester";  

  • In this example variable is blog and string are programming codester. 
  • To use strings, you must include an additional header file in the source code, the <string> library. 
  • Example of string with object-oriented programming with c++. 

 

So, you should try this example to learn string better. 

So now out next topic is, 

C++ String Concatenation 

String Concatenation 

Concatenation means adding two or more strings. 


The + operator can be used between strings to add them together to make a new string. This is called concatenation: 





Explanation of the example: 

  • We declared two different string variables b1 and b2 and we stored different string in it and sum of that string and stored another variable b3 and printed it. 
  • Now we want some space between the 2 strings. 
  • So, its example here: 

 

If we need space, we enter space like that. 


So, I hope u understood about string with c++: 

In the next tutorial we will be learning other operators in detail. 

C tutorials: 

So, guys if you want to do a master's in coding, you should practice the program every day. 

Thank you for your support! 

Learn and explore! 

 

 

 

Comments

Popular posts from this blog

C programming | Printf and scanf ||

C programming | structure | Fundamentals of Structure

C programming | Fundamentals & Basic information

Basic question related programming || c programming || embedded programming

C++ || Operators with c++

Compiler & Interpreter | difference and explanation

c++|operators with c++|variables||

C programming | Nested structure | Array, function and pointer of structure|| structure Part-II

C++(oop)| Fundamentals | Concepts||