Thread: okey another section, pls post here the 'things to remember' :)

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    142

    okey another section, pls post here the 'things to remember' :)

    thanks guys, i'm collecting these things coz i'm planning to make a website for this, to act as a reference or something,

    okey here goes my example,

    Always remember to attach the '&' on a variable when passing it on a function that asks for pointer, do not typecast it.

    example,

    function(LPCSTR* variable);

    should be...
    function(&variable);

    and not...
    function((LPCSTR)variable);

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    142
    nobody contributing? hmm.,

    okey, remember that pointers are 4 bytes

    sizeof(pointer) = 4;

    to get the exact length of a pointer to a string, use strlen()

  3. #3
    "The Oldest Member Here" Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,039
    not if the pointers are on the free store

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In need of guidance
    By ajdspud in forum C++ Programming
    Replies: 7
    Last Post: 06-01-2016, 02:23 AM
  2. Maths For Game Programming?
    By kolliash in forum Game Programming
    Replies: 13
    Last Post: 09-18-2008, 11:53 AM
  3. pls post here tricks that you know of in C/C++, thanks
    By mickey in forum C++ Programming
    Replies: 55
    Last Post: 06-12-2003, 04:28 PM