K
karthikbalaguru
Hi,
String constant being modifiable in C++ but, not modifiable in C.
that is,
In C++, the following example output will be "Mplusplus"
char *str1 = "Cplusplus";
*str1 = 'M';
In C, the above example will produce an error as we are trying to
modify a constant.
So, str1 is not a string constant in C++.
Does it mean that string constant concept is absent in C++ ?
Thx in advans,
Karthik Balaguru
String constant being modifiable in C++ but, not modifiable in C.
that is,
In C++, the following example output will be "Mplusplus"
char *str1 = "Cplusplus";
*str1 = 'M';
In C, the above example will produce an error as we are trying to
modify a constant.
So, str1 is not a string constant in C++.
Does it mean that string constant concept is absent in C++ ?
Thx in advans,
Karthik Balaguru