Joshie, no double posting please. If you have something to add to your post and it hasn't been at least 24 hours, you should edit your post with the new information. Thanks.
_player1537 wrote:
Joshie, no double posting please. If you have something to add to your post and it hasn't been at least 24 hours, you should edit your post with the new information. Thanks.
Exactly this. Smile It looks like you've been in good hands with David and Tanner, who are still learning and somewhat still learning respectively, which is good. Do you still have any outstanding unanswered questions at the moment?
EDIT: fixed, yay me! Smile I had to change the file to a C++ source file, instead of a blank document. Hmph Razz

This is starting to stress me out Sad
I'ts now giving me errors when I build/run, that have no reason for being there. I just got an error for using this..

Code:

#include <iostream>          // file not in directory
#include <string>               // file not in the directory also

I even tried to run the program I wrote yesterday, that I know 150% was working yesterday, and those same errors again :S
Those are valid C++ things, but if you're compiling it as C instead of C++, you have to use:


Code:
#include <stdio.h>
#include <string.h>

etc
I assume you're likely accidentally compiling as C. What compiler are you using? You probably already said and I missed it in the thread.
I am using Code::Blocks with GNU compiler, as suggested by scoutdavid, and many thanks to him, because it works awesome Smile it seems the only problems I have had with the problem are through my own ignorance of C Very Happy

UPDATE: so far in my C++ book, I am on page 160/1192, and I have covered variables, equations, and right now am on loop statements. I plan to finish the book by the end of july-ish, and then I will start coding my very first game, which I am hoping to be a tower defence game Smile
Honestly I wouldn't start with a game, you will end up setting your hopes to high, then get upset because you probably won't be able to do it.
OK little bit of confusion... Pointers!
I don't get the point of pointers (redundancy pun lol).
Why not just use int/long/double/etc?
why use a pointer? makes no sense to me Sad
A pointer is actually very useful Wink I'm no C expert, but I can tell you that many aspects of lower-level C coding use them, as well as higher-level concepts as well. Strings for one can be manipulated with them. You can use them to write to other files. You can store things in actual places in memory rather than random-area ints. The possibilities are endless Very Happy
So if you were to say... Save a highscore; you would use a pointer, and not a int/double/long/etc?
joshie75 wrote:
OK little bit of confusion... Pointers!
I don't get the point of pointers (redundancy pun 0x5).
Why not just use int/long/double/etc?
why use a pointer? makes no sense to me Sad


Because storing big things on the stack is incredibly stupid. You don't use pointers to an int, long, double, etc..., you use them for structs, arrays, and classes.
More reasons to use pointers:

>> Dynamic allocation! You can't very well compose and restructure any kind data structure including trees, linked lists, queues, stacks, you name it without either dynamic memory allocation or super-awkward hacks with large, fixed-size, inefficient reservation in the stack or heap.

>> Passing mutable data to functions: Say you want a function to change the value of an integer. Passing an int won't help, because that's a pass-by-value. Passing a pointer to an int will definitely help. C++ has nifty pass-by-reference syntax, but C lacks it, so pointers are your friend.

Pretty much any advanced programming concepts and moderately complex C/C++ program uses pointers, and the languages would be much much less powerful without them.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement