Results 1 to 4 of 4
  1. #1
    ✝ Pursuit of Happiness ✝ Sh0x's Avatar

    Badge

    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
         User Info     Contact     Gamer ID
    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
    Gamer IDs

    Gamertag: iiSh0x

    Contact info:

    Youtube Channel: http://www.youtube.com/zSh0x

    Default Easier Way To Define a Non-Changing Variable in C

    This cannot be used in Call of Duty, because variables are constantly changing.

    Defining a changing variable
    Code:
    {
          int Score;
          Score = 10;
     }
    Non-Changing Easier Way
    Code:
    #define Score 10
    Just thought I would let you guys know, I see most people always define variables the longer way even when it can be easier.
    Simple but helpful :p

    0 Not allowed! Not allowed!

  2. #2
    Robot Universe Owner
    Creator of DarkFrost
    demon450's Avatar
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
         User Info     Contact     Gamer ID
    Join Date
    Apr 2010
    Location
    New York
    Posts
    2,714
    Points
    6,203
    Gamer IDs

    Gamertag: Medius450 PSN ID: Medius1337

    Contact info:

    Youtube Channel: http://www.youtube.com/user/Roceso1337

    Default

    or you can use the 'const' keyword
    Code:
    const int Score=10;

    0 Not allowed! Not allowed!
    Check out Darkfrost
    Check out Robot Universe






  3. #3
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    I'm sorry for getting just a tad off topic, but what's the point of a variable if it doesn't change?
    x = "hi";
    say(x);

    I made up that say thing cause Idk C syntax. It just doesn't make much sense, I mean maybe if your going to say "hi" a lot through the code but then again, what's the point of limiting what it can do?

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  4. #4
    ✝ Pursuit of Happiness ✝ Sh0x's Avatar

    Badge

    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
         User Info     Contact     Gamer ID
    Join Date
    May 2012
    Location
    North Carolina
    Posts
    2,843
    Points
    3,181
    Gamer IDs

    Gamertag: iiSh0x

    Contact info:

    Youtube Channel: http://www.youtube.com/zSh0x

    Default

    Demon if you use const can it change and CheeseToast it is just easier if you use the variable a lot.

    Sent from my MOTWX435KT using Tapatalk 2

    0 Not allowed! Not allowed!





Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 11:49 PM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.