Hi I Have a Huge Doubt. While Printing Out Char Arrays We Don’t Iterate like a[i] rather we do a. Why? Also Why Should I Use Strings Class over Char Arrays?
When Would I Use Strings Over Character Arrays?
hi @JaveedYara character arrays have some special properties, that allow us to directly print the value of entire array like cout << a instead of having to iterate like a[i]
String datatype is newer so it has more features. It is more readable, easier syntax, faster than character arrays, and more secure along with better error handling.
@JaveedYara you might find this article helpful https://embeddedartistry.com/blog/2017/07/26/stdstring-vs-c-strings/