+ 3

How to print string using array

26th Jul 2020, 3:19 PM
Jaypal Koli
3 Antworten
+ 5
Although you can display a string directly using printf() or "cout" But if you want to use the array method then Consider string as a character array ending at NULL('\0') character and display it like a normal array. like this 👇 for(int i = 0 ; arr[i] != '\0' ; i++) { cout<<arr[i]; }
26th Jul 2020, 3:22 PM
Arsenic
Arsenic - avatar
+ 3
Suppose you want to print a string name big: to print big: In C: printf("%s",big); In C++: cout<<big;
26th Jul 2020, 3:34 PM
The future is now thanks to science
The future is now thanks to science - avatar
0
And in java: System.out.println("big");
27th Jul 2020, 11:07 AM
Lalkar Zirange
Lalkar Zirange - avatar