Is this true? .:Resolved:.
I saw this message on another programming forum and I didn't agree with some of the things he was saying about C strings in C compared to C++ and some other comments. This was in responce to a newbie asking a question about programming. Any clarification would be great.
Quote:
I only suggest C because C++ starts to take power away from the programmer. I very much enjoy doing cstring manipulations. I find it very interesting. I have an assignment that can use some of my tools I have written in my data structures class (which must be in C++). I ran into this very irratating feature of C++. A line of code such as:
Code:
char *a = "Hello, world!";
would produce a nice ready to use cstring that I can start manipulating that is compiled into the binary. However, in C++, that cstring is placed into (read only/const char*) memory. Not even a type cast fixes it. So I must waste my cycles dynamically putting the string into r/w memory. Little things like this that turn up turn me away from C++. Strong typing which forces you to type cast ANY conversion between datatypes is somewhat annoying. References take away from forcing a programmer to learn and use the power of pointers.
Now don't get me wrong, these elements of C++ are great, really great for a big project that can have many errors that these syntax features will catch at the compilation level, but for learning reasons, one should really consider the power of a programming language to get the best understanding of what is going on. After I learned the very basics of C, I jumped into Java and then C++.