Join 307,137 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,834 people online right now. Registration is fast and FREE... Join Now!
I prefer endl to \n. When a program is working properly, it doesn’t matter which one you use. But when a program crashes, \n might mislead you. If there are any un-flushed data in the buffer when a program crashes, the un-flushed data can’t make it to the screen, or whatever destination. So what you see on the screen is not the actual output the program has written. You don't want to debug the code with the partial output.
This post has been edited by hir_sus_jp: 26 Oct, 2007 - 11:39 PM
Very well documented tutorial. Once upon a time I wrote code in C++ and have been wanting to get back to it, but needed an understanding of how to store data properly before I picked it up again. I especially loved the in depth instructions for the Binary Search Tree, as I had only gotten to Linked Lists previously and always wondered exactly how they worked.
This post has been edited by tody4me: 18 Jan, 2008 - 10:12 AM
I'll be writing a sequel soon in which I plan to include more complex data structures (and their operations) as well so be sure to check the Tutorials section for updates.
hi! thank you for your tutorial,.. it's a big help.. but can you help me on my project? It's about banking transaction system.. that keypad 1=open new account, 2=deposits, 3=withdraw, and 4 = close account.. I can make only one account.. but my prof. need 5 accounts.. can you help me.. plzzz!
This post has been edited by cold-blood: 18 Jul, 2008 - 04:12 AM
I'm new to c++ and new to this forum. I find the data structure tutorial very easy to read and understand. I haven't yet tried all the code yet. but I did do the one for stack (push and pop) and when I compiled, I got the error:
37 C:\c++Stuff\Stack.cpp [Warning] converting to non-pointer type `int' from NULL
I am using bloodshed's dev c++, so I thought I'd let you know that is whats happening. So if there is an error somewhere it would be nice to fix it. Does anyone else have any similar compilation errors with any of the code listed in the tutorial?
I fixed up the minor error in the stack class by replacing the NULL with 0. Now it compiles and runs fine.
I have since tried the queue class and there are a couple of minor typos ie., ensure that tmp is actually spelt temp, and in the second for loop in the main method, you need to declare iter as int iter; if you dont want keep typing the data type for every for loop, just declare it as a global in the main, like such: int iter.
After fixing up those, I ran the program and did not get the same output as in the example. this is what i got instead:
i have a problem! if the condition is true at the first while it works...but at the second "while" it doesn't delete the node that the condition is true for!thank you for helping me