Page 1 of 2
C++ Help!
Posted: Thu Sep 25, 2008 6:23 pm
by Nitro
We started to programing in C++, and I got really interested into it...
I have few questions about it, so any help would be appreaciated, I want to make some things clearer.
1. What is the difference between C++ and Dev-C++? We are programing in Dev-C++.
2. We started doing Variables, there are few new terms
- char [1 byte]
- short int [2 byte]
- int [4 byte]
- long int [4 byte]
Why do we use them? What does it matter if something has 2 bytes more / less?
Why cant I write everything in long int? Why cant I write everything in short int?
What is the difference between int and long int? Since they are both 4 bytes.
3. We have Signed and Unsigned stuff.
Signed = Pozitive and Negative values
Unsigned = Pozitive only values (including zero)
Now this is what I'm not 100% sure do I understand
char = 1 byte (8 bit) = (in decimal system) 2^8 = 256.
*Unsigned = 0 to 255 // = 256 (we must include zero, right?)
*Signed = 256 / 2 = 128;
Maximum Negative Value = -128
Maximum Positive Value = 127 // (once again we include zero) = 128 nubmers
Meaning Signed = -128 to 127 , right?
What about binary system here?
Is there easier way to calculate the Signed values? I just made this way, idk any other, I'm looking in my notebook and I'm trying to find logic, and I found this.
Same thing goes to Int
int = 4 byte (32 bit) = (in decimal system) 2^32 = 4 294 967 296.
*Unsigned = 0 to 4 294 967 295
*Signed = 4 294 967 296 / 2 = 2 147 483 648;
Maximum Negative Value = -2 147 483 648
Maximum Positive Value = 2 147 483 647 // (once again we include zero) = meaning -1
Meaning Signed = -2 147 483 648 to 2 147 483 647.
Right?
How do I know whats signed / unsigned value for binary numbers?
How can I calculate them?
Thank you very much, any help is appreciated!

Re: C++ Help!
Posted: Thu Sep 25, 2008 6:31 pm
by endymion
well usually depending on the variable ur reading...and negative numbers start with the last bit 1
so if u got a 8 bit data...with signed can only represent 2^7 top bcz the last bit is reserved for sign.
well all that stuff u can just google it
Re: C++ Help!
Posted: Thu Sep 25, 2008 6:36 pm
by ThiefzV2
i will try to answer you based on what i remember from when D2A taught me C++
1. What is the difference between C++ and Dev-C++? We are programing in Dev-C++.
Dev-C++ is an IDE (integrated dev environment), and is just a diff implementation of C++, just like Borland C++, MS Visual C++, etc. they are all basically the same except the fancy GUI. dev-c++ is free while many others are not.
We started doing Variables, there are few new terms
* char [1 byte]
* short int [2 byte]
* int [4 byte]
* long int [4 byte]
Why do we use them? What does it matter if something has 2 bytes more / less?
Why cant I write everything in long int? Why cant I write everything in short int?
What is the difference between int and long int? Since they are both 4 bytes.
variables are used to store variables and to manipulate them in memory. it's a lot easier to work with variables than with constants when doing algorithm
What does it matter if something has 2 bytes more / less?
yes, it adds up fast and use a lot of memory and become a memory hog. compare vista to windows xp for example.
Why cant I write everything in long int?
inefficient use of limited resources. and long loading time, swapping to hard drive, slow ass programs, etc.
Why cant I write everything in short int?
short int can be way to small to hold some data and can cause buffer overflow or incorrect results. for instance, when joymax programmed silkroad they used to use usigned 16-bit (2 bytes) variables, so the maximum damage was 65,535 since 2^16-1 = 65,535 anything higher than that, you will see a lower damage. u know something is wrong when a level 80 nuker zerk up on a mangyang and do a 500 dmg
What is the difference between int and long int? Since they are both 4 bytes.
C++ standards require int to be at least 2 bytes, and long ints to be at least 4 bytes. some compilers implemented it differently. they gave int more space so dumb programmers wont cause buffer overflow.
---------
the unsigned number allows for more flexibility before upgrading to conserve RAM.
Cruor / NuclearSilo, I'm counting on you ^^
D2A > Cruor > me > NuclearSilo

Re: C++ Help!
Posted: Thu Sep 25, 2008 6:42 pm
by Nitro
Thank you very much ThiefzV2

That sure helped, I got suprised when I read that Silkroad thing (what about now, since damage cap isnt 65 535 now? Did they reprogramed it to 4 bytes, is the damage cap 4 294 967 295? Isnt reprograming again huge time consuming job?)
Any other help? About Binary signed and unsigned, how can I calculated that?
Re: C++ Help!
Posted: Thu Sep 25, 2008 6:43 pm
by ThiefzV2
Nitro wrote:Thank you very much ThiefzV2

That sure helped, I got suprised when I read that Silkroad thing.
Any other help? About Binary signed and unsigned, how can I calculated that?
i dont understand what u are trying to ask.
what do u mean by:
How do I know whats signed / unsigned value for binary numbers?
How can I calculate them?
Re: C++ Help!
Posted: Thu Sep 25, 2008 6:48 pm
by Nitro
ThiefzV2 wrote:Nitro wrote:Thank you very much ThiefzV2

That sure helped, I got suprised when I read that Silkroad thing.
Any other help? About Binary signed and unsigned, how can I calculated that?
i dont understand what u are trying to ask.
what do u mean by:
How do I know whats signed / unsigned value for binary numbers?
How can I calculate them?
Well, Decimal system has their own Signed and Unsigned values.
I think proffessor mentioned binary nubmers ...
There is a question ... "What is Minimal Binary, Minimal Decimal, Maximal Binary and Maximal Decimal value for Int (4 bytes) - Signed and Unsigned.
I'm not that crazy to convert Decimal to Binary. (not at that huge numbers.)
Re: C++ Help!
Posted: Thu Sep 25, 2008 6:52 pm
by Teddybeer
Cruor????? NuclearSilo....
COME NAO ROAWR ANSWER HIM xD
Re: C++ Help!
Posted: Thu Sep 25, 2008 7:56 pm
by ThiefzV2
Nitro wrote:Thank you very much ThiefzV2

That sure helped, I got suprised when I read that Silkroad thing (what about now, since damage cap isnt 65 535 now? Did they reprogramed it to 4 bytes, is the damage cap 4 294 967 295? Isnt reprograming again huge time consuming job?)
Any other help? About Binary signed and unsigned, how can I calculated that?
yeah they fixed it already.
Isnt reprograming again huge time consuming job?
depends on the programmer. if you program the code well, it takes only one line of code to change eveyrthing. d2a taught me to use header files (ext .h) and use typedef statements to define your datatype, so when you want to change your datatype, all you have to do is just change 1 line and all your datatypes are autochange on compile and linking time. if you don't, be prepare to get a huge headache by going thru all your code and recode them one by one. chances are u will fack something up. good programmers will use a structured form with encapsulation, polymorphism, and modularity in their programming. poor programming will cause data insecurity too. thats how d2a hack into the bot database and into joymax database. but knowledge can also be used for good too to secure your own account or friends account or to gain knowledge of the game and etc.
Well, Decimal system has their own Signed and Unsigned values.
I think proffessor mentioned binary nubmers ...
There is a question ... "What is Minimal Binary, Minimal Decimal, Maximal Binary and Maximal Decimal value for Int (4 bytes) - Signed and Unsigned.
I'm not that crazy to convert Decimal to Binary. (not at that huge numbers.)
are u sure that is the exact quote cuz u dont make sense at all. is he talking about the theoretical value for the binary representational? when a number is in binary mode and it's signed, then the leftmost bit is wasted to represent the positive or negative sign. if an unsigned number is used, the 1 bit is free up to be used, so u can use that knowledge to calculate the theoretical minimal and maximal theoretical value for 4bytes (32-bit) ints.
Decimal = 10 = uses digits 0thru9 to represent
Binary = 2= uses digit 0 and 1 to represent.
int decimal, signed values in the range -2^n-1 to +2^(n-1)-1.
And converting from decimal to binary is easy.
let try convert the number 69 to binary.
1(
64) + 0(
32) + 0(
16) + 0(
8) + 1(
4) + 0(
2) + 1(
1)
see the pattern?
so 69 can be written in binary as 1000101
D2A can do the conversion instantly in his head when he taught me binary system. i dont know how, maybe theres some trick to it, but for me i have to write them all out.
any question, pm this guy ->
http://silkroadaddiction.com/forum2/mem ... ath2u.htmlask him anything... programming questions/math/science/hacking/psychology/engineering/riddles/puzzle/whateva...anything u ask.... 99.999% chance he will know
Re: C++ Help!
Posted: Thu Sep 25, 2008 8:05 pm
by iGod
Decimal to binary: divide the decimal number with 2, whats left (either 1 or 0) is the binary number, but the remains should be read from the last one to the first one.. i guess thats the most no-brainer way to do it.
so lets say 37/2=18 (1) 18/2=9 (0) 9/2=4 (1) 4/2=2 (0) 2/2=1 (0) 1/2=0 (1)
so in binary 37=100101
Re: C++ Help!
Posted: Thu Sep 25, 2008 8:16 pm
by Nitro
ThiefzV2 wrote:Nitro wrote:Thank you very much ThiefzV2

That sure helped, I got suprised when I read that Silkroad thing (what about now, since damage cap isnt 65 535 now? Did they reprogramed it to 4 bytes, is the damage cap 4 294 967 295? Isnt reprograming again huge time consuming job?)
Any other help? About Binary signed and unsigned, how can I calculated that?
yeah they fixed it already.
Isnt reprograming again huge time consuming job?
depends on the programmer. if you program the code well, it takes only one line of code to change eveyrthing. d2a taught me to use header files (ext .h) and use typedef statements to define your datatype, so when you want to change your datatype, all you have to do is just change 1 line and all your datatypes are autochange on compile and linking time. if you don't, be prepare to get a huge headache by going thru all your code and recode them one by one. chances are u will fack something up. good programmers will use a structured form with encapsulation, polymorphism, and modularity in their programming.
Can I get short-quick example of what you said? I understood, but I cant picture it in my head.Well, Decimal system has their own Signed and Unsigned values.
I think proffessor mentioned binary nubmers ...
There is a question ... "What is Minimal Binary, Minimal Decimal, Maximal Binary and Maximal Decimal value for Int (4 bytes) - Signed and Unsigned.
I'm not that crazy to convert Decimal to Binary. (not at that huge numbers.)
are u sure that is the exact quote cuz u dont make sense at all. is he talking about the theoretical value for the binary representational? when a number is in binary mode and it's signed, then the leftmost bit is wasted to represent the positive or negative sign. if an unsigned number is used, the 1 bit is free up to be used, so u can use that knowledge to calculate the theoretical minimal and maximal theoretical value for 4bytes (32-bit) ints.
I think its theoretical value, I'm not sure... I know there isnt negative value for Binary...
Let me quote from my notebook, I didnt wrote it all at class / correct I'm afraid ...
____Min Bin _____ Min Dec. ___ Max Bin ______________ Max Dec.
Int: 1 + 31 zero's // -1*2^31 // 11111.... (31 of them) // 2 147 483 647
Unsing:___0_____//___ 0 ___//___ 111111.... (32 of them) // 4 294 967 295Decimal = 10 = uses digits 0thru9 to represent
Binary = 2= uses digit 0 and 1 to represent.
int decimal, signed values in the range -2^n-1 to +2^(n-1)-1.
let try convert the number 69 to binary.
1(
64) + 0(
32) + 0(
16) + 0(
8) + 1(
4) + 0(
2) + 1(
1)
see the pattern?
so 69 can be written in binary as 1000101
Yeah I know how to convert Dec to Bin, but 69 is small numberD2A can do the conversion instantly in his head when he taught me binary system. i dont know how, maybe theres some trick to it, but for me i have to write them all out.
any question, pm this guy ->
http://silkroadaddiction.com/forum2/mem ... ath2u.htmlask him anything... programming questions/math/science/hacking/psychology/engineering/riddles/puzzle/whateva...anything u ask.... 99.999% chance he will know
Good to know
Re: C++ Help!
Posted: Thu Sep 25, 2008 11:02 pm
by NuclearSilo
D2A > Cruor > me > NuclearSilo
lol
So arrogant
How old are u btw?
P.S: D2A knows nothing about Ouija Board.

And if someone is too smart with high IQ. There's smt which is not normal in him.
Re: C++ Help!
Posted: Fri Sep 26, 2008 4:59 am
by Nitro
NuclearSilo wrote:D2A > Cruor > me > NuclearSilo
lol
So arrogant
How old are u btw?
P.S: D2A knows nothing about Ouija Board.

And if someone is too smart with high IQ. There's smt which is not normal in him.
Instead arguing who is smarter, why dont you help me instead?

*goes to school*
D2Alisam Ftl
Re: C++ Help!
Posted: Fri Sep 26, 2008 8:13 am
by NuclearSilo
They basically answered all questions. What u didnt understand?
Re: C++ Help!
Posted: Fri Sep 26, 2008 10:37 am
by ThiefzV2
Nitro wrote:ThiefzV2 wrote:depends on the programmer. if you program the code well, it takes only one line of code to change eveyrthing. d2a taught me to use header files (ext .h) and use typedef statements to define your datatype, so when you want to change your datatype, all you have to do is just change 1 line and all your datatypes are autochange on compile and linking time. if you don't, be prepare to get a huge headache by going thru all your code and recode them one by one. chances are u will fack something up. good programmers will use a structured form with encapsulation, polymorphism, and modularity in their programming. poor programming will cause data insecurity too. thats how d2a hack into the bot database and into joymax database. but knowledge can also be used for good too to secure your own account or friends account or to gain knowledge of the game and etc.
Can I get short-quick example of what you said? I understood, but I cant picture it in my head.
that is an advance topic. an example would be the length of an essay. best to understand the simple concept and stuff first then work your way up from beginner to pro.
NuclearSilo wrote:D2A > Cruor > me > NuclearSilo
lol
So arrogant
How old are u btw?
P.S: D2A knows nothing about Ouija Board.

And if someone is too smart with high IQ. There's smt which is not normal in him.
im basing it on the fact u dont know how to write a 8 line code doing simple arithmetic...
viewtopic.php?f=12&t=95791 it's true why are u loling? are u claiming that u are a better programmer than d2a?
howd u know that he knows nothing about Oujia Board by not asking him? and why do you think people that is "too smart with high IQ" then it means that the person is "not normal"? yes some, but not all. i thought u are good at logic?
the only thing thats not normal about him is that he refuses to handgrind for more than 15 mins. he told me that handgrinding isn't "intellectually stimulating" so he seeks doing something elsea nd let a program do it more efficiently and faster. he's a botter unfortunately, but then again, many people ARE botters... so that doesn't mean he's not normal because a huge majority of people that play this game bot.
Re: C++ Help!
Posted: Fri Sep 26, 2008 11:51 am
by NuclearSilo
im basing it on the fact u dont know how to write a 8 line code doing simple arithmetic...
viewtopic.php?f=12&t=95791 it's true why are u loling?
lol
i fixed that program. In fact, u dont know what's wrong in that code too.
are u claiming that u are a better programmer than d2a?
when? Quote plz
howd u know that he knows nothing about Oujia Board by not asking him?
Who said i didnt ask him? Or u just guess on your own?
and why do you think people that is "too smart with high IQ" then it means that the person is "not normal"? yes some, but not all
99.9% they are. Even Einstein had smt abnormal in him

Re: C++ Help!
Posted: Sun Sep 28, 2008 9:39 am
by Cruor
ThiefzV2 wrote:D2A > me > NuclearSilo > Cruor

Corrected. Remember guys, I am not a programmer.

I may seem to be master with computers, but really what I do is nothing more than anyone else could do given enough patience. So please, for the love of god, stop bringing me up in every math, programming and cryptography topic on here, because I am not this expert you seem to see me as.
Re: C++ Help!
Posted: Sun Sep 28, 2008 11:32 am
by NuclearSilo
U are modest and at least honest. Unlike a cat which boast that he is a tiger just because he is friend with a tiger lol.
About dignity:
Cruor > Me > D2A > Thiefz
Re: C++ Help!
Posted: Mon Sep 29, 2008 5:39 pm
by ThiefzV2
NuclearSilo wrote:U are modest and at least honest. Unlike a cat which boast that he is a tiger just because he is friend with a tiger lol.
who is the cat and who is the tiger?
Re: C++ Help!
Posted: Mon Sep 29, 2008 5:47 pm
by Doron
wait, C++ is a computerprogram?
I thought it was geekslang for cupsize double c...
I'll just go back to my corner nao...
Re: C++ Help!
Posted: Mon Sep 29, 2008 5:49 pm
by lmpulse
Icealya wrote:wait, C++ is a computerprogram?
I thought it was geekslang for cupsize double c...
I'll just go back to my corner nao...
i lol'd
Re: C++ Help!
Posted: Mon Sep 29, 2008 6:52 pm
by Stress
OT: I enjoyed the replies in this thread. Doing C++ at the moment too, and it was really useful. Thumbs up

[Off-Topic]I'm just going to drop by and boast about my IQ as everyone does. Seems that's the trend recently.
Remember the Gauss curve? I'm on the right side of the apex, where the "graph" line is practically parallel to the horizontal axis.

Re: C++ Help!
Posted: Mon Sep 29, 2008 7:11 pm
by DarkBandit
only 1 word for me >> WHATEZEEEEEEEFARGMANNNNNBBBRAINOVERRRRLOADDDOVVVVVVNERDDDDTALKKKKKKKKK
Re: C++ Help!
Posted: Mon Sep 29, 2008 7:50 pm
by Doron
DarkBandit wrote:only 1 word for me >> WHATEZEEEEEEEFARGMANNNNNBBBRAINOVERRRRLOADDDOVVVVVVNERDDDDTALKKKKKKKKK
okay, that was your share of the OTL...
Back to GD with you.. c'mon, do I really have to steal Millenium's whip again?
Re: C++ Help!
Posted: Tue Sep 30, 2008 6:36 pm
by ThiefzV2
ONTOPIC:
Stress wrote:OT: I enjoyed the replies in this thread. Doing C++ at the moment too, and it was really useful. Thumbs up

ur wellcome
OT:
Stress wrote:[Off-Topic]I'm just going to drop by and boast about my IQ as everyone does. Seems that's the trend recently.
Remember the Gauss curve? I'm on the right side of the apex, where the "graph" line is practically parallel to the horizontal axis.

Pics or it didn't happen.

take your iq test here
http://silkroadaddiction.com/forum2/off ... 25551.html and it will generate u a nice "Gauss curve" and then post the pic here cuz the only person i know that has the IQ fittin your description is D2A and his result in the thread confirm my thinking
Re: C++ Help!
Posted: Wed Oct 01, 2008 2:10 pm
by Plutonium
wheres a good place to starting learning c++?
Re: C++ Help!
Posted: Wed Oct 01, 2008 2:54 pm
by Nixie
Plutonium wrote:wheres a good place to starting learning c++?
http://www.cplusplus.com/src/Should be enough for the first time. Else just type 'C++ tutorial' into Google.
Re: C++ Help!
Posted: Sat Oct 04, 2008 6:42 pm
by ThiefzV2
Nixie wrote:Plutonium wrote:wheres a good place to starting learning c++?
http://www.cplusplus.com/src/Should be enough for the first time. Else just type 'C++ tutorial' into Google.
You can't learn C++ by looking at source codes
Re: C++ Help!
Posted: Sat Oct 04, 2008 6:49 pm
by Stress
ThiefzV2 wrote:ONTOPIC:
Stress wrote:OT: I enjoyed the replies in this thread. Doing C++ at the moment too, and it was really useful. Thumbs up

ur wellcome
OT:
Stress wrote:[Off-Topic]I'm just going to drop by and boast about my IQ as everyone does. Seems that's the trend recently.
Remember the Gauss curve? I'm on the right side of the apex, where the "graph" line is practically parallel to the horizontal axis.

Pics or it didn't happen.

take your iq test here
http://silkroadaddiction.com/forum2/off ... 25551.html and it will generate u a nice "Gauss curve" and then post the pic here cuz the only person i know that has the IQ fittin your description is D2A and his result in the thread confirm my thinking
Ask Death2All how intelligent I am, then. We've had contact in the past.

Re: C++ Help!
Posted: Sat Oct 04, 2008 6:55 pm
by Nixie
ThiefzV2 wrote:Nixie wrote:Plutonium wrote:wheres a good place to starting learning c++?
http://www.cplusplus.com/src/Should be enough for the first time. Else just type 'C++ tutorial' into Google.
You can't learn C++ by looking at source codes
How could I do it? With a clear explanation of the code, plus the optimal code (no not-needed things) you can learn more than anywhere else. I wouldn't know PHP, mySQL, C++, C#, JavaScript, HTML and much more if I didn't download, download and download again. Everything I analysed some code and tried to figure out what it does I've added more to my knowledge. Maybe not everybody can do it the same way, but that's how I did it.
Re: C++ Help!
Posted: Sat Oct 04, 2008 8:55 pm
by ThiefzV2
Nixie wrote:ThiefzV2 wrote:You can't learn C++ by looking at source codes
How could I do it? With a clear explanation of the code, plus the optimal code (no not-needed things) you can learn more than anywhere else. I wouldn't know PHP, mySQL, C++, C#, JavaScript, HTML and much more if I didn't download, download and download again. Everything I analysed some code and tried to figure out what it does I've added more to my knowledge. Maybe not everybody can do it the same way, but that's how I did it.
i guess we all have a diff way of learning then. have a portfolio?
Stress wrote:ThiefzV2 wrote:ONTOPIC:
Stress wrote:OT: I enjoyed the replies in this thread. Doing C++ at the moment too, and it was really useful. Thumbs up

ur wellcome
OT:
Stress wrote:[Off-Topic]I'm just going to drop by and boast about my IQ as everyone does. Seems that's the trend recently.
Remember the Gauss curve? I'm on the right side of the apex, where the "graph" line is practically parallel to the horizontal axis.

Pics or it didn't happen.

take your iq test here
http://silkroadaddiction.com/forum2/off ... 25551.html and it will generate u a nice "Gauss curve" and then post the pic here cuz the only person i know that has the IQ fittin your description is D2A and his result in the thread confirm my thinking
Ask Death2All how intelligent I am, then. We've had contact in the past.

if you are so intelligent like u claim, then why dont u take the IQ test and post the picture and show your "right side of the apex, where the "graph" line is practically parallel to the horizontal axis."
