View Poll Results: Which do you use

Voters
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%

Which do you use?

This is a discussion on Which do you use? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hungarian all the way. One variable per line. Initialize. Use Unicode Macros. char* lpszText = NULL; or LPTSTR lpszText = ...

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

    char* lpszText = NULL;

    or

    LPTSTR lpszText = NULL;

    hth
    -nv

    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
    Location
    Waterloo, Texas
    Posts
    5,657
    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?

    *humph*



    ITSA
    Socket Library!

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

    *humph*
    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 02: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.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

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