http://newdata.box.sk/bx/c/
Read everything at this site, and do all the activities. Then figure out what you want to achieve with a program, and try to do it.
http://newdata.box.sk/bx/c/
Read everything at this site, and do all the activities. Then figure out what you want to achieve with a program, and try to do it.
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Then don't work with windows yet - theres plenty more to C++ then pointers and structures. Once you get bored, try looking into the Standard Template Library.
Do not make direct eye contact with me.
SAMS BOOK! VOID MAIN! KILL THE LINK NOW BEFORE IT SPAWNS!Originally posted by bennyandthejets
http://newdata.box.sk/bx/c/
Read everything at this site, and do all the activities. Then figure out what you want to achieve with a program, and try to do it.
Do not make direct eye contact with me.
I don't remember it using void main. Although, it has been a couple years now.
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
There's tons you can do in console mode...you definitely want to get used to as many topics as you can in console mode before you move to windows programmingwell I don't know what kind of program to write. I only know a little bit, enough for a console program. If it comes down to windows apps, I'm screwed
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Then don't work with windows yet
Best piece of advice yet. As for the STL I still have yet to really dive into it. I've used it but not extensively. There's always something else to explore in programming. That's why we love it so much.
You'll never master it all.
Well the part i looked at had it.....anyway its still a 21 days book - not many people here trust it, they arent very good on average.
EDIT: and just look at the first 3 lines of their hello world:
Code:#include <iostream.h> int main(){
Do not make direct eye contact with me.
Thank you so much everyone for helping out. I have learned a LOT more than I expected tonight.
But, it is to everyone's disappointment that this post will come to its demise. It grew so fast! lol... Oh well, it's been fun! I'll work on programming stuff! Thanks for everything!
--MrDoomMaster
The kind of DooM that makes the MooD
Ok, I just checked it. They use int main() religiously. And it's a very good book, it's how I learnt most of my c++.
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Actually its rather refreshing this thread is ending - cuz it's making my head spin.
But I'm sure at least 50 or so more people will bump it.
It's been real. And to my fellow partners in crime...it's been fun guys.
Yay! OK DON'T POST NOW JAWIB.Originally posted by MrDoomMaster
Thank you so much everyone for helping out. I have learned a LOT more than I expected tonight.
But, it is to everyone's disappointment that this post will come to its demise. It grew so fast! lol... Oh well, it's been fun! I'll work on programming stuff! Thanks for everything!
j/k .
Do not make direct eye contact with me.
*Tries to keep mouth shut*Yay! OK DON'T POST NOW JAWIB.
Darn.
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
I'll be the first.But I'm sure at least 50 or so more people will bump it.
Well, I got back in a little late, and though I tried to read over everything, some of that was a bit hard to follow. Anyways, this should be helpful on the difference between pointers and references.
Both do essentially the same thing. They point to a address in memory. A reference is a much 'safer' version of a pointer, however.
A reference:
- Must point to an already existing object
- Cannot be null
- Cannot be changed (that is, it cannot point to a different object later)
- As it creates no memory, never requires the user to cleanup
To create a reference, you use & after the type:
int a; // Create a new int
int& x = a; // Create a reference to a named x
A pointer:
- Can point to an existing object (using the addressof - & - operator if what you are assigning it to is not already a pointer), a newly allocated object (using 'new'), or an array of newly created objects (using 'new[]')
- Can be null (0)
- Can be changed
- Depending on how it is used, may require cleanup (using 'delete' or 'delete[]'), or may not, but you better be sure not to use something that you've already destroyed
Here are some pointer examples:
int a;
int* b = &a;
int* c = b;
int* d = new int;
int* e = new int[10];
delete d;
delete[] e;
Another difference in behavior comes with polymorphism. If you unsuccessfully dynamic_cast a pointer, you will have a null pointer returned. If you unsuccessfully dynamic_cast a reference, an exception will be thrown.
Also, some notes on const.
const type& - means that the object pointed to by the reference cannot be changed through the reference.
const type* - means the data pointed to by the pointer cannot be changed through the pointer, but you can change what data is pointed to
type* const - means that you cannot reassign the pointer, but you can change the data it points to
and...
const type* const - means the pointer cannot be reassigned, nor can you change the data it points to
Note that type& const is redundant
const type* = type const*
const type& = type const&
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
I asked earlier about decent compilers, anyone have any recommendations? I'm using Bloodshed Dev-C++ compiler, and the interface is amazing. I really like it. Any comments?
--MrDoomMaster
The kind of DooM that makes the MooD
I need a post in this thread.Originally posted by MrDoomMaster
I asked earlier about decent compilers, anyone have any recommendations? I'm using Bloodshed Dev-C++ compiler, and the interface is amazing. I really like it. Any comments?
If you like it; use it. If you can get your hands on a copy of MSVC though... it's very nice. Assuming you're coding on a windows machine.
GCC is probably the most standards compliant compiler that you're likely to find, but doesn't have an IDE. It's free, though. Unlike MSVC (assuming legal means).
Away.