Results 1 to 3 of 3

Thread: Is this true? .:Resolved:.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member voidflux's Avatar
    Join Date
    Jun 2003
    Location
    Brockway, PA
    Posts
    290

    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.

    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++.
    Last edited by voidflux; Apr 17th, 2004 at 11:59 AM.
    C¤ry Sanchez
    Computer Science/Engineering
    @ Penn State
    IBM.zSeries Intern
    Mandriva 2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width