[Hints] C++ menu

User Tag List

Thread: [Hints] C++

Results 1 to 6 of 6
  1. #1
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Hints] C++

    :Hint I:

    Here's a few examples of what your allowed to write when writing in C++, so that you wont get any errors.

    int awesome; // valid
    int Awesome; // valid and distinct from poodle
    int AWESOME; // valid and even more distinct
    Int really; // invalid -- has to be int, not Int
    int doodle_a2 // valid
    int _doodlea2; // valid but reserved -- starts with underscore
    int 4show; // invalid because starts with a digit
    int double; // invalid -- double is a C++ keyword
    int begin; // valid -- begin is a Pascal keyword
    int __noobs; // valid but reserved – starts with two underscores
    int the_awesome_variable_of_all_time; // valid
    int shit_tard; // invalid -- no hyphens allowed

    :Hint II:

    Arrays

    "An array is a data form that can hold several values, all of one type. For example, an array can
    hold 60 type int values that represent five years of game sales data, 12 short values that represent
    the number of days in each month, or 365 float values that indicate your food
    expenses for each day of the year. Each value is stored in a separate array element, and the
    computer stores all the elements of an array consecutively in memory."

    "To create an array, you use a declaration statement. An array declaration should indicate three
    things:
    • The type of value to be stored in each element
    • The name of the array
    • The number of elements in the array"

    The Array as Compound Type

    "An array is called a compound type because it is built from some other type. (C uses the term derived
    type, but, because C++ uses the term derived for class relationships, it had to come up with a new
    term.) You can’t simply declare that something is an array; it always has to be an array of some particular
    type. There is no generalized array type. Instead, there are many specific array types, such as
    array of char or array of long. For example, consider this declaration:
    float loans[20];
    The type for loans is not “array”; rather, it is “array of float.” This emphasizes that the loans array
    is built from the float type."

    [Hints] C++
  2. #2
    mgX's Avatar Member
    Reputation
    39
    Join Date
    Feb 2008
    Posts
    98
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im very much against the oldschool hungarian type of naming... It was used back in the days, so people would know what type the actual variable was. Usually ppl name constants AS_SOMETHING_STUPID, which looks ridiculous aswell. Ive come to favor the newer type of naming, where one would do:

    somethingHere - private members
    SomethingHere - public members
    _somethingHere - reserved as in, do not touch!

    To me it looks much prettier, and with intellisense theres no longer any need for enforcing the hungarian naming. PascalCase ftw

  3. #3
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by mgX View Post
    Im very much against the oldschool hungarian type of naming... It was used back in the days, so people would know what type the actual variable was. Usually ppl name constants AS_SOMETHING_STUPID, which looks ridiculous aswell. Ive come to favor the newer type of naming, where one would do:

    somethingHere - private members
    SomethingHere - public members
    _somethingHere - reserved as in, do not touch!

    To me it looks much prettier, and with intellisense theres no longer any need for enforcing the hungarian naming. PascalCase ftw
    qft. (o_q)

  4. #4
    mgX's Avatar Member
    Reputation
    39
    Join Date
    Feb 2008
    Posts
    98
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by -Jebus Fist- View Post

    qft. (o_q)
    is it me, or wasnt this topic meant as a debate on variable naming? I believe my input is valid on that. If you meant to go down the hungarian naming road, you barely even covered the basics, not even including prefixes...

  5. #5
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually go with PascalCase/CamelCase because imo it looks nicer and helps me remember which variables are which.

    I live in a shoe

  6. #6
    Spectre90's Avatar Contributor
    Reputation
    92
    Join Date
    Jan 2008
    Posts
    77
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by mgX View Post
    Im very much against the oldschool hungarian type of naming... It was used back in the days, so people would know what type the actual variable was. Usually ppl name constants AS_SOMETHING_STUPID, which looks ridiculous aswell. Ive come to favor the newer type of naming, where one would do:

    somethingHere - private members
    SomethingHere - public members
    _somethingHere - reserved as in, do not touch!

    To me it looks much prettier, and with intellisense theres no longer any need for enforcing the hungarian naming. PascalCase ftw
    While I agree and even use some of this style, IIRC Identifiers with _ at the beginning are reserved and we should not use them in our style/naming conventions as it interferes with the standard.

    Although I honestly believe the chances of someone actually causing a conflict by using that style are extremely low, it shouldn't be considered good practice for anyone learning who may not fully understand the implications.

Similar Threads

  1. simple world exploration hint
    By inuyasha9x in forum World of Warcraft Exploration
    Replies: 2
    Last Post: 01-08-2007, 04:50 PM
  2. A hint to changing character to creature textured
    By joshuawn in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 01-05-2007, 07:27 PM
  3. Few helpful hints :)
    By coltcannon69 in forum World of Warcraft Guides
    Replies: 6
    Last Post: 12-17-2006, 07:32 PM
  4. Another possible hint towards GM island.
    By idusy-org in forum World of Warcraft General
    Replies: 19
    Last Post: 08-14-2006, 03:09 AM
All times are GMT -5. The time now is 10:11 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search