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

This is a discussion on okey another section, pls post here the 'things to remember' :) within the C++ Programming forums, part of the General Programming Boards category; thanks guys, i'm collecting these things coz i'm planning to make a website for this, to act as a reference ...

  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
    Intranasal Heroin User Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,035
    not if the pointers are on the free store

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Maths For Game Programming?
    By kolliash in forum Game Programming
    Replies: 13
    Last Post: 09-18-2008, 11:53 AM
  2. In need of guidance
    By ajdspud in forum C++ Programming
    Replies: 5
    Last Post: 09-10-2006, 01:43 PM
  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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21