Introduction / More MS Visual C 2005 Express Edition
Subtitles of the Movie
Alrighty, we're back here in Visual C Plus Plus 2005 Express Edition and we have our hello world program up there that we just created and I assumed that you are stopping back in after the last video so I am just going to keep right on going from where we were, we haven't do anything different. We're seating here with our console right line program and hello world and now weÔre just going to add a few lines to it and make sure that we can make a simple modification and get it to work. So we'll just drop out to the end of our line there and hit enter and let's start adding to the program. We're going to use this same class and same method out of it and that's two colons defines the separation between the class and the method from the class. Now notice with the, I think they call it intell-i-type something like that, I'm sure there's some great marketing word for it, the integrated development environment, the IDE wants to help us out and if you forget how to write something or type it in you know exactly how was the spelling of this thing then it'll come up and give you a list of all of the different methods that are available to the console class. So there's all kinds of cool things that we can do in there and what we want is similar to the write line, we're just going to do write and there it pops up for us and it also shows us what it's looking for next and where this is, its in the core library, it's in the system namespace and all that, gives us a little hint about write just so we can kind of remember how to use it. We use our open param and then there's 18 different interfaces, there's 18 different possible things that we can put in there and it'll hint at each one of them, exactly what we need to get it correct of all the different things that we can write. We can write doubles out and decimal values and all kinds of other interesting things. We want to do is put another piece of text and we'll use this indicator and then we'll say my name is and a space and then we'll close that and close the print in the semi colon and it fixes it right up for us. Now notice the difference between console write and console write line. Write line will put a new line, carriage return, after the phrase and write does not. So there my name is and its going to leave a blank and we'll come down to the next line and we'll start console and two colons, now notice that, isn't that interesting we don't have a drop down list of all the interfaces. Well you know why? Because we have typoed, see the beginning of console, and I knew that I wanted you to see what happens, I don't have a capital C there. So if back up and fix that, that's kind of an easy indicator to me that I messed that up a little bit. If you don't the completion, the auto typing that you think you should be getting, take a look at the line before you finish it off, you probably fat fingered something in there. So now we put console and the two colons and there's our familiar list, OK that's what we're looking for, now we can finish with a write line so we get a nice carriage return and a L and your double quotes and I'll put my name in there, I assume or expect you to put your name in there, not mine, and we'll put a semi colon out at the end of it. Now that looks like a nice simple addition to our program. Let's go up here to debug and we will start without debugging because we want to see our wonderful handiwork here. And there you go we have two calls added to console write which did the my name is part, and then the console write line which did the actual name and then took us down to the next line. If I didn't do the write line here this P of press would be right up there, it would not have taken us down to the next line. OK pretty simple but I wanted to make sure that your system is working and everything is functioning, notice the green lines says all of that has been saved, or has been compiled once anyway if we do a save selected items it wants to make sure where we are going to put this. Oops I'm, sorry its got the wrong focus its in the output billed window, see my focus is down here and that's not where I wanted it because that's where it was from when we compiled and if you do a save from there it wants to save this text down here just so you know what it just tried to do. But its an easy way to save this output if you have a bunch of errors or a bunch of different warnings you want to go through them on paper one by one, you can save it off and print it or do something like. Let me put the focus back up here where I wanted it to be. When my focus is in the code I'll save hello world. See its even prompting me, save hello world, CCP, so there that's tucked away and we can save the whole project as well with that so that's our changes and everything is working the way we expect it to. So if it did it, the same thing on yours, good job, let's move on to our next chapter.
Tutorial Information
| Course: | C++ Fundamentals |
| Author: | Tim Heagarty |
| SKU: | 33797 |
| ISBN: | 1-934743-09-7 |
| Release Date: | 2007-09-14 |
| Duration: | 4 hrs / 55 lessons |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 