B1ackAnge1 (09-14-2009),why06 (09-14-2009)
if you'd normally acces something from a normal struct or class you'd use
but if we were to create a pointer to that class we'd have to useCode:testmyclass.testint;
which could also be written asCode:testmyclass->testint = 4;
somehowCode:(*testmyclass).testint = 4;
t
c
l shows up as stars o__O
Last edited by Hell_Demon; 09-14-2009 at 03:30 PM. Reason: sorry its late, thx zeco
B1ackAnge1 (09-14-2009),why06 (09-14-2009)
It's Quite Simple really:
MyClass x;
x.DoSomething();
MyClass *y = new MyClass();
y->DoSomething();
MyClass* z = &x;
z->DoSomething();
*z.DoSomething();
You have to use -> when dealing with references/pointers to objects (heap) and '.' when dealing with it directly(stack)
the Double Colon only comes into play with the static stuff & namespaces
Edit: *looks above* yeah that! lol
Hell_Demon (09-14-2009),why06 (09-14-2009)
Well actually
Oh and the :: operator is for scope, so like BA said, namespaces and static stuff.Code:(*testptr).testint = 4;
Which book are you using why06?
Oh and @ black angel, for what i wanted to do to work, i also needed a way to convert back to managed string.
It was, get managed string, convert to std string or char*, convert back to managed string. I managed the second part, just not the third.
Hell_Demon (09-14-2009)
woah D: Calm down guys.... I got a book. believe it or not I do read. I just said it gives me a lil trouble (looked it up the very second I wrote that. Haha XD) don't need an explanation, but thx anyway I guess o_O
LOL
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
B1ackAnge1 (09-14-2009)
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
No Questions = No Learning = Staying Stupid
We coders gotta stick together & help each other out !
Hell_Demon (09-15-2009)
Questions are good, it means you're interested.
People with an 'I want to learn gamehacking in C++ please give me all your source code so I can copy+paste and claim it as my own' attitude is what I really hate.
Why06 is a perfect example of someone that asks questions that would actually help him, or another person out(and you can see he is interested and also posts his own code to show you what he has done so far).
JMonking however is one of the people that asks the same question over and over, and in the end ignores everything we said and goes his own way again.
My advice: Listen to those who know what they're doing, listen to their opinions, do NOT try to run before you can walk(so no making hacks untill you've learned the basics of a language).
One last note: It's way more satisfying when you can make your own hacks, especially if you can share it with others. if you copy paste and are still a retard at the end of the run it will have no use at all.
Thanks for reading,
Hell_Demon(aka R3B3L and TehKiller)
P.S. this is just my 2 cents, do whatever you wish with this information ^^
B1ackAnge1 (09-15-2009),why06 (09-15-2009)
Amen to that!
Nothing worse than a CopyPaste 'Dev'....
Yeah i agree. Asking questions is a great way to learn. Hmm i should post little projects once in a while like why06 >_<. I really need more practice. But i'm bad at thinking of things to do since i'm not creative.
I've actually found a little book of C++ problems. They are little programs with one or two things wrong with them. It's pretty easy stuff not to hard, but keep you on top of your game. I plan to start posting the one about once a day when I move away from beginner stuff and start getting into more technical C++. So I don't forget what I learned while learning ASM and managed C++.
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
Ooh, that sounds awesome. Actually finding errors in code has always greatly entertained me. What is the book called?
P.S. Managed C++ rots your brain. It would be better to learn C#.
Except that might greatly confuse you since C# is like half java looking, half C++ ish. So the lines of syntax would probably get too blurred for you to remember xD.
I also think Why06 is a little confuzzled between Managed C++ and plain old Win32 C++
Remember:
C = derived from 'B'
C++ = C + Object Orientation etc
Win32 C++ = windows API using C++
Managed C++ = .NET using C++
C# = .NET using C#
VB.NET = .NET using VB
ASP.NET = ASP using .NET with either VB.NET or C# lol
F# = well.. you can guess (except it's 'functional programming' which is not my cup of tea)
Last edited by B1ackAnge1; 09-15-2009 at 05:58 PM.
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower