Array and String with CPP
Array:-
An array in C or CPP is a collection memory locations and elements can be accessed randomlyusing an array location. They are used to store similar types of elements as in the data type
must be the same for all elements. The elements of the array are located side by side in Memory.
We can use third parentheses[] for array size
একই ধরনে র ডেটা টাইপের গুচ্ছকে অ্যারে (Array) বলে ।
We have two types of arrays:
1)One Dimensional Array2)Multi Dimensional Array
Simple Example:-
String:-
We can Simply said String is Cha. a word, a sentence a paragraph everything is stringfor example:-"Hello World", "Welcome to MEZBAH Tech Dairy"
Now we can declare and print write simple program
Explain:- Avobe This example we can print the string in Hello, we declare an array of size 50 char,
but our string Only 5 char. So we don't need to declare such a large array.
Here good to said when are declare string and after finished all char we have default null char'\0'
You can see bellow this example
#Sug_Url for string:- Strings and String functions with examples (beginnersbook.com)
#Thanks for reading#
Comments
Post a Comment