I guess I was not the most clear in that one line
std::cout is a function I know this I was trying to say that, what I was implying is you will not do something like
int cout; at some point in...
Type: Posts; User: Ewiv
I guess I was not the most clear in that one line
std::cout is a function I know this I was trying to say that, what I was implying is you will not do something like
int cout; at some point in...
Then it would be much simpler if the class controlling the list did the adding to the list not another class. I think your over complicating the program a bit and thats causing some of your...
You declare a pointer to head, but you never declare head to point to an actual node
After setting newNode you should have head point to that to start your list. Doing that means head will point...
Well, if you're not in a class and being taught to do it that way. IE you are teaching yourself, lets get you off on the right foot. Actually, we should do that either way. :)
Heres an excellent...
Consider watching this video, Bjarne covers a really neat and safe way to handle file open and close in there that would really benefit your code.
Yea I tend to write my programs like that as well. I will get them working and then go back and refine them. I am still learning myself but as I go back and refine them I try and remember for future...
If you want, post op your current code and we'll help you refine it more. :)
Otherwise congrats on your conquest and best of luck on climbing the next mountain in your learning process :)
int checkForWinner (string position[3][3])
Has a lot of repeating code. Any time you start seeing repeating code you want to look for ways of turning the repeating code into a function to reduce...
As was said it lets you take arguments into your main function and do something with them. Games use this often to set screen size etc on the fly based on a script file that the user can then change...
So write us a program, if you have problems getting it to work, show us the code and we will help you learn. We don't do your homework for you here.
Take a shot at coding it yourself. Google and your school book are your friend. If you run into problems post us some code so we know you put effort into trying and we can help you get the code...
You're accessing memory still, that will display random numbers. Very undesirable behavior.
No, lets look at another example
int foo[10];
foo[7] = 22;
fun1(foo[7]); //this passes the value 22 into fun1 because thats what foo[7] equals. However fun1 wants an array so this is a...
Yea I agree. The way your using that enum it would be a lot better to have done something like:
const int MAX = 50;
This while loop will never run.
int beer_on_the_wall()
{int i=100;
while( i <100 && i >=0)
{
cout << "Bottles of beer on the wall.";
i--;
}
You need a pointer to point to that node so you can delete it after changing the links.
Show us your whole main.cpp code so we can see it.
What you should be doing is creating a structure. values to the structure and then pass that structure into addObject. I am guessing you are not...
Show us some code :)
I believe the goal of his assignment is to iterate through the string printing 1 letter at a time. Advice is awesome, doing the code work for him defeats the purpose and teaches him nothing.
Look at like 16 of your code for starters jocdrew21
And don't forget your
#include <string>
character.h|11|error: 'Object' was not declared in this scope|
Where is your structure declaration of Object :)
Wow, I missed this one the first read through.
temp = NULL;
in your first code bracket line 3. Wouldn't that set the argument you are passing in to NULL?
From my understand all that does is mean you can use NodePtr or node to refer to that structure. It does not mean you no longer have to declare pointers to that structure as pointer. I may be...
NodePtr head;
NodePtr current;
Not pointers, these are variables. I believe you want pointers here.
Give us the code to the functions so we can find your error. I'm sure you can see as we can see that the 5 lines of code you pasted is not the issue. Post your full solution if you want some help.