Sign in to follow this  
JWalsh

C++ Workshop - Data & File Streams (Ch. 17)

Recommended Posts

Welcome to the GDNet C++ Workshop – Ch. 17

For a complete introduction to this workshop, please look here. Workshop Overview This workshop is designed to aid people in their journey to learn beginning C++. This workshop is targeted at highly motivated individuals who are interested in learning C++ or who have attempted to learn C++ in the past, but found that without sufficient support and mentoring they were unable to connect all the pieces of this highly complex but powerful programming language. This is a 'guided' self-teaching C++ workshop. Each student is responsible for taking the time to read the material and learn the information. The community and tutors that arise out of this workshop are here for making the learning process run more smoothly, but are not obligated to baby-sit a person's progress. Because everyone will be working from the same textbook (Teach Yourself C++ in 21 days 5th Ed.), students may find it easier to get answers to the specific questions they might have. There is no minimum age requirement, and there is no previous programming experience required. Additionally, this workshop does not attempt to defend C++ as a language, nor does it attempt to demonstrate that C++ is either more or less useful then other programming languages for any particular purpose. People who intend to start a discussion about the differences between C++ and ANY other languages (except as are relevant to a particular discussion), are encouraged to do so elsewhere. This workshop is for educational, not philosophical discussions. Quizzes & Exercises Each week will have quizzes and exercises posted in the weekly threads. Please try and answer them by yourself. As well, please DO NOT post the answers to Quizzes and Exercises within this thread. Once it becomes acceptable to post the answers to quizzes and exercises, an additional thread will be created each week specifically for the purpose of posting quiz answers. If you try with reasonable effort but are unable to answer the questions or complete the exercises, feel free to post a clarification question here on the thread. Tutors, myself, or others will do the best we can to point you in the right direction for finding the answer.

Chapter 17 – Working with Streams

Introduction Heya all! Here we are in week 17. Only 3 more weeks to go before we bring the workshop to a close. This week we'll be covering streams, i/o formatting, and special methods for getting input and sending output to the standard i/o devices. Finally, the chapter will wrap up with applying some of these techniques to the fstream classes for interacting with files. This will be especially useful for the current project. Speaking of which... Take a look at Project 2 if you've not already done so. It builds upon the topics covered in chapter 1, and also provides some new and interesting challenges for project design. As a tie in to this week, I encourage everyone to set up the program to read the room information in from file, allowing you to create new rooms, and change the connections between rooms just by modifying files on disk. See ya next week! Outline of the Reading - Chapter 17
  1. Overview of Streams
  2. Streams and Buffers
  3. Standard I/O Objects
  4. Redirection of the Standard Streams
  5. Input Using cin
  6. Other Member Functions of cin
  7. Outputting with cout
  8. Streams Versus the printf() Function
  9. File Input and Output
  10. Using the ofstream
  11. Binary Versus Text Files
  12. Command-line Processing

Good Luck!

[Edited by - jwalsh on May 30, 2007 5:35:11 PM]

Share this post


Link to post
Share on other sites
There have been a slow down lately, but that doesn't mean that the project is dead. However, jwalsh can't continue to speak in the void, so I suggest you to remotivate him by showing your interest to this workshop.

jwaslh is a great professional, who used much of his time to animate this workshop, but in the end it's up to you to give him the feeling that he should continue or not. The C++ workshop is really a Great Thing (as you may see, it spawned two other interesting workshops as well) and is really a good introduction to C++.

So let's revive it the way it deserves it.

Regards,

Share this post


Link to post
Share on other sites
Yeah!!!! I always come here to see how thing are coming out. Unfortunetly I could not follow the workshop from the beggining, because I was busy by the time it started.
I'm reading C++ How To Program(as i remember jwalsh recommended it) hoping to start Project 1(after i cover the stuff thats needed) followed by Project 2. These projects were a really good and creative idea.

So I just want to give my feed back, the workshop is great and i think this material should be always available.

Sadly, only one person is not going to convence him to keep the project alive(i also dont think he should waste his time with the workshop, if no one is listening to him), but those that are following(i'm sure there are some), should give some feedback, post your questions and exchange ideas.

regards

Share this post


Link to post
Share on other sites
I also just recently started the workshop, and trying to catch up, even though it takes a little more time when you have two jobs, church, and college as well.

This is an excellent and most definitely the best way I have found to learning C++. I hope that it also continues to stay up and flowing, as I would love to see the end result of all of this.

:-)

Share this post


Link to post
Share on other sites
I haven't been following the workshop at all, mainly because I know most all that you have been covering, however, it wouldn't be a bad idea to keep going, just so there is a free C++ resource somewhere else that actually teaches step-by-step.

That's my input.

Cheers!

Share this post


Link to post
Share on other sites
Quote:
Original post by F1N1TY
I haven't been following the workshop at all, mainly because I know most all that you have been covering, however, it wouldn't be a bad idea to keep going, just so there is a free C++ resource somewhere else that actually teaches step-by-step.

That's my input.

Cheers!

Then you should have signed up as a mentor [smile]

Share this post


Link to post
Share on other sites
I'm in the same boat, just found this workshop and loved it. Using my Christmas break to try to get caught up. I haven't started any of the projects yet but I'm on the arrays chapter right now. I'm using the 2nd edition of the text and supplementing it with some other books I have. Just making myself known so when I start the projects I can run any questions by. Its been awhile since I've programmed in C++ (or any language really) so I feel like I'm starting at scratch. It has been a great read though and just what I need to motivate me to get off other games and begin making my own :) You should really keep it going.

Share this post


Link to post
Share on other sites
Hello all,

First off I must say BRAVO!! for doing something like this. I am a beginner programer and I have read so many how-to books with not much success. The biggest problem is not having a "Mentor" or tutor to show me where and how to implement the code. So far all the books I have read tell you all this code with no direction as to where to put it. So putting together something like this is just wonderful. I thank you for doing something like this.

I am starting from the beginning since I just found the thread so hopefully my questions can be answered from the previous reply's. Thank you again!!

Share this post


Link to post
Share on other sites
Just stopped by to say that I'm in the same boat as some of the guys who posted here before me.

I hadn't known about this workshop for that long, but I have been following it for the last few weeks. Just wanted to thank jwalsh and all the other tutors that have helped us beginners so much, with absolutely nothing to gain from it.

I hope to see the workshop continue!

My best regards to all!

Share this post


Link to post
Share on other sites
I just wanted to say hello to everyone, well.. assuming there's an everyone left. I stumbled onto this forum last weekend. I really wish I could have been a part of it from the begining. I have about 6 books on C++ and not a one of them explains the language clearly. I've had to concactinate the books together to get as far as I was. I own 2nd and 4th edition of 21 days, and after browsing the forums while reading the book, most of the fog I was seeing through is clearing up. I want to thank ALL of the mentors and JWALSH for organizing and planning this workshop. Pointers at one time had a 100% evasive manuever stat against me. After reading through the forums, heh, pointers still suck, but they only evade me about 10% of the time now. I hope to get caught up with everyone this weekend, but it's alot of material to catch up on. It may not be a realistic goal. Not to mention, I haven't attempted to do either of the projects yet.

To all those that have played a helping hand in the publishing of this forum, my sincerest thanks and appreciation.

Share this post


Link to post
Share on other sites
Alas, I have returned. Better late than never, the remaining chapters will be posted, along with a postmortem to help other workshop authors avoid some of the mistakes I made and the difficulties I encountered.

Cheers!

Share this post


Link to post
Share on other sites
I'm all like, "hey, good to see you back jwalsh! We misssed you!"

Now we are going to redirect C++ learner to the workshop again [smile]

(did I say that I'm happy to see you again on these boards?)

Share this post


Link to post
Share on other sites
Haha, thanks Emmanuel. Good to be back.

I'll be out of town for a week to visit my wife's grandfather in Oregon. (He's having open heart surgery). But when I return next weekend I'll post the remaining chapter threads, and the postmortem.

Quote:
Now we are going to redirect C++ learner to the workshop again


Perhaps after the workshop is "completed," it could be converted into a forum about C/C++ and moved up with the other forums in "The Technical Side".

It seems that since C++ is the predominant language of choice for game development, it may warrant its own forum. Then, any questions about the language itself, STL, etc...can be directed to that forum. We could even post in the forum FAQ some questions about C++ vs. C#, C++ vs. Java, etc...regarding popularity in game development, etc...Although, much of this seems right at home in "For Beginners" I suppose.

Just a thought. Not sure what you guys here at GD.net plan to do with the workshop once the remaining chapters have been posted.

At any rate, talk to you later!

Share this post


Link to post
Share on other sites


Hey all I am sort of new to c++.. I have been doing a course on it for some time and I think a course that would really get people involved would be a hands on course like that in the book Beginning C ++ Through Game Programming, Second Edition. Here is a link with some Information. http://www.courseptr.com/ptr_detail.cfm?group=Game%20Development&subcat=Programming&isbn=1%2D59863%2D360%2D0

I believe that this is a good book and anyone who wants to get into programming games straight off yet still with a good foundation then i recommend this book.

If you can't afford the book or it is not in stock then take a look at this site:
http://www.gametutorials.com/gtstore/c-3-c-tutorials.aspx

This comes with C++ game Tutorials, C Tutorials, Open GL Tutorials, Direct3d Win32 , Java 350 + tutorails. The C++ ones slowly introduce you into C++ bu pick it up and lead on to make a rpg. Its resonably priced at $60. Downloadable or Can Buy it as Cd form.

Though if you really cannot afford anything take a look at:
http://www.cppgameprogramming.com/cgi/nav.cgi?page=index

This teaches you some basics of C++ and then leads you into simple 2D game development with the Allegro Library. It has quite a welcoming community. Though I have yet to find really indepth tutorials :P

And If you a want to learn or discuss about graphics, coding ect in a smaller environment. Get some nice links and discuss C++ Coding, Multimedia and Other stuff visit my site and forum at. http://dejai.ifastnet.com/

Thank you for you time and I hope that you enjoyed this Post!

Share this post


Link to post
Share on other sites
Quote:
Original post by Dejai


Hey all I am sort of new to c++.. I have been doing a course on it for some time and I think a course that would really get people involved would be a hands on course like that in the book Beginning C ++ Through Game Programming, Second Edition. Here is a link with some Information. http://www.courseptr.com/ptr_detail.cfm?group=Game%20Development&subcat=Programming&isbn=1%2D59863%2D360%2D0

I believe that this is a good book and anyone who wants to get into programming games straight off yet still with a good foundation then i recommend this book.

If you can't afford the book or it is not in stock then take a look at this site:
http://www.gametutorials.com/gtstore/c-3-c-tutorials.aspx

This comes with C++ game Tutorials, C Tutorials, Open GL Tutorials, Direct3d Win32 , Java 350 + tutorails. The C++ ones slowly introduce you into C++ bu pick it up and lead on to make a rpg. Its resonably priced at $60. Downloadable or Can Buy it as Cd form.

Though if you really cannot afford anything take a look at:
http://www.cppgameprogramming.com/cgi/nav.cgi?page=index

This teaches you some basics of C++ and then leads you into simple 2D game development with the Allegro Library. It has quite a welcoming community. Though I have yet to find really indepth tutorials :P

And If you a want to learn or discuss about graphics, coding ect in a smaller environment. Get some nice links and discuss C++ Coding, Multimedia and Other stuff visit my site and forum at. http://dejai.ifastnet.com/

Thank you for you time and I hope that you enjoyed this Post!


The purpose of the C++ Workshop on GameDev.Net is not to learn how to "maek games" but to learn the language itself. If you read the introduction, you should know that we are using "Teach yourself C++ in 21 Days (5th Edition)" (which has been chosen after a long discussion). "Beginning C ++ Through Game Programming" just doesn't have the same goal, and I don't think that this book should be used to learn the basics of C++ (although you can use it if you want).

Regarding the other tutorials/web sites you cited - don't worry, we know them, but again: this is a C++ workshop, not a "game programming with C++" workshop.

(and if you want to advertise your web site, feel free to do it in the Your Announcement forum; not here, unless there is a goooooood reason to do so [smile]).

Regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this