Tips for C/C++ programming?

Discussion in 'Programming/Html' started by kakik09, Jun 15, 2012.

  1. gamerk2

    gamerk2 Ancient Guru

    Messages:
    2,108
    Likes Received:
    1
    GPU:
    NVIDIA 570 GTX 1.2 GB
    I think you mean "exclusively". Of the 100 or so titles I have installed, only ONE used a non-MSVC compiler.

    But yeah, Programming = Logic. Without the second, you can't do the first.

    As for the discussion about API's above, remember the more abstraction, the less performance you get. OpenCL is nice, as are mid-level API's, but they are slow compared to native OS calls [20% or so slower]. Depending on your apps performance, you may have to code at that lower level to squeeze performance, even if it makes porting a pain [or impossible].
     
  2. adrien117

    adrien117 Guest

    Messages:
    12
    Likes Received:
    0
    GPU:
    AMD hd 7970m
    programming is simple dude

    Just dont try to learn anything by heart... practice a lot and always try to refer from books (C++ pimer is good one). Keep your mind open and Love it :) you will see, C++ is a very nice and powerful language... you just need to give some efforts... (Y) :)
     
  3. haz_mat

    haz_mat Guest

    Messages:
    243
    Likes Received:
    1
    GPU:
    1070 FE
    std::string has a method called c_str() that returns a null-terminated LPCSTR (long pointer to constant string). Any reason you would want to avoid that?

    My advice for the OP: First off, its good to start out with basic procedural programming, like how to get input/output, working with function calls and their arguments\returns, looping through arrays, doing simple math, etc. Those ideas are universal to programming, regardless of what language you use. When I was around this point in my education, I was starting to wonder a lot about where the 'stuff' I write is actually getting stored in memory. Once I learned how pointers and references work, it was one of those rare 'woah' moments. The more you can get your hands dirty with working on memory, the better - segmentation, fragmentation, memory pools, and garbage collection make a lot more sense when you have a deeper idea of how computers deal with the memory space.
     
    Last edited: Aug 21, 2014

Share This Page