Few Questions
Just some simple questions, what would be better in the functions? (Performance wise)
Code:
Code:
Also, are 'enums' just like defines, but in a struct like form? Code:
Code:
|
Re: Few Questions
Quote:
|
Re: Few Questions
enum CsTeams {
CS_TEAM_UNASSIGNED = 0, CS_TEAM_T = 1, CS_TEAM_CT = 2, CS_TEAM_SPECTATOR = 3 }; so when you declare a new var using enum, e.g. new CsTeams:team so the possible value of team is only 0/1/2/3. #define is a preprocessor directive, just place a symbol with its defined value when compile. so new team; the value of team could be any int value in its range. bad english sry. |
Re: Few Questions
Okay, and just one more question. When i see stuff like
Code:
|
Re: Few Questions
my english is really bad to explain that. hope you can understand
3 decimal = 00000011 binary 5 decimal = 00000101 binary & | ~ << >> these are bit operator. so 3&5 means 00000011 00000101 result: 00000001 << means bit left move 1 decimal = 00000001 binary 1<<1 means 1 left move 1 bit result: 00000010 binary = 2 decimal |
Re: Few Questions
here's how decimal versus binary works:
if your decimal would be 32 it is: Code:
binary(scale): 1 2 4 8 16 32 64 128 256 512 1024your binary is: Code:
binary(scale): 1 2 4 8 16 32 64 128 256 512 1024Some relative information :) just finished this study last year. |
| All times are GMT -4. The time now is 07:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.