For error detection I would write code to ensure that all the digits are initilized into the array. Example if input is 123 the char array should be filled with 00123\n instead of 123/n(random...
Type: Posts; User: Maghappy
For error detection I would write code to ensure that all the digits are initilized into the array. Example if input is 123 the char array should be filled with 00123\n instead of 123/n(random...
OK I just ran your code and seem some room for inprovement.
1.)make your member variables protected. This gives you control over what is allowed to changeyour data and how.
2.)use your classes...
First of all your BIGGEST mistake is by not defining a default constructor. This can and will lead to hard to find problems. Also you could make a class Person and derive the others classes from...
Kinda new at file io but doesn't the first instance of a stream being attached to a file make it read and write protected from other streams unless specified not to be?
I wouldn't mind helping any if you need any assistance just drop me a line sometime. Is it going to be a windows program or console application?
DBZ fan huh? I have the damage values used in the Dragonball Z card game on hand if you would like them. Values are based on physical combat but implimenting energy attacks wouldn't be to hard once...
Why did you do get year the way you did? I don't see the logic in just not returning a value from the member function.
fstream fin(fileName);
Try initilizing the fstream in the constructor. I believe that the nocreate and in flags can only be set at creation. But I could be wrong, initilizing at creation has...
I really wish I could find a good tutorial on File IOStreams. I understand a little, just enough to et my self confused. :confused:
Personally I would just create a new linked list from the two with a loop to read from them into it. Mainly like a constructor with arrays of head nodes, then it would loop threw each head node...
Hpp. Please note I had to save the extension the header as a .c or it wouldn't upload so just change it to LinkedList.hpp
cpp
bump from the dead:confused:
Coincidence I think not.:D
I have a decent linked list at home I will post the source code when I get there.
Depends on what the list is storing. Also what is the linked list runing in(windows enviorment or dos box).
The biggest cause of memory leaks for beginner programmers is stray pointers. Stray pointers occur when you lose focus of a pointer but don't delete the variable it pointedto on the heap. The...
What are you trying to draw in? A SDI windows program maybe. The simplest way is to get a client DC to draw on(example in MFC) and use the line to function.
void CMainWnd::OnLButtonDown(UINT...
I'll give you the short answer for now then latter I will post a great example for you. The problem is in how you need to look at the linked list. I would make a LinkList object, have it create a...
Here it is for you. New and improved and full functional. A few suggestions I might include are:
1) The program could use a infinite for loop to repeat until a break is called.
2) Could...
Declare srand at the beginning of the main function
main()
{
srand( (unsigned)time( NULL ) );
//then the rest of your code
try using #include <time.h>
You should initially seed the program with this line. Please note that it should only be seeded once or it will return the same number again and again.
srand( (unsigned)time( NULL ) );
int...
LOL
I can tell already I am going to like this online community. You guys think like me.
OK, now that I know how to write and read the class from a file where should I go from there? I don't need to be able to print it so text mode isn't neccessary. Can I use the data returned from a...
Hello,
I am new to your boards but am a little experienced in C++. I am having troubles grasping the concept of File IO, if anyone has a link to a good tutorial or can explain it to me I will be...