View Poll Results: Which do you use

35. You may not vote on this poll
  • char* name;

    10 28.57%
  • char *name;

    21 60.00%
  • char * name;

    4 11.43%
  • Other (plz post)

    0 0%

Thread: Which do you use?

  1. #31
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Hannover, Germany
    Hungarian all the way. One variable per line. Initialize. Use Unicode Macros.

    char* lpszText = NULL;


    LPTSTR lpszText = NULL;


    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  2. #32
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Waterloo, Texas
    I always go for as few words as possible, and always c-style lowercase:

    bool open;
    double total_elements;

    ...and I never use truncated words if at all possible (which is mainly why I hate hungarian so much). What's more clear, anyway? LPCSTR lpszCmdLine or const char * command_line?

    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
        return std::pow
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;

  3. #33
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Originally posted by Sebastiani
    What's more clear, anyway? LPCSTR lpszCmdLine or const char * command_line?

    char* CmdLine;

    I've started with Win32 API this week and I can't understand why they call char pointers like LPSTR. It just doesn't make sense to me. I know more or less what it stands for but... It's not a pointer to a string, it's a pointer to a char!
    And putting lpsz before the name? Crazy!
    Something I didn't say in my original post is also that I use char* becouse when I'm reading it's like:
    char* name;
    char pointer called name. Clear.
    char *name;
    i think something like: char, ok, oh, wait, it's a char pointer called name. Takes me much longer to read believe it or not. Or at least to understand
    Last edited by -=SoKrA=-; 02-05-2003 at 03:53 PM.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

Popular pages Recent additions subscribe to a feed