![]() |
|
#1
|
|||
|
|||
Redirection within Microsoft Visual Studio.Net 2003I am on my last lab assignment for the class.
The code portion of the assignment is written, complied, and working. However, the last part of the question asks, What happens when the output is redirected, is the screen still cleared? (I was to include the system("cls") function at the beginning of a program that was already written in a previous chapter). The problem is that I cannot figure out how to make the redirection work so I can find the answer. I've tried compiling the program inside and then going out to the command prompt and I have tried the command prompt inside Visual Studio but can't get it to work. Can anyone help with step-by-step directions?Thanks! I have to tell you all. This forum is favored and commended over the others out there for the genuine help and lack of smack and attitude toward the student/beginner/inexperienced programmer. Thanks a bunch from all of us that are still trying. ![]() |
|
#2
|
|||
|
|||
Re: Redirection within Microsoft Visual Studio.Net 2003Quote:
Ahhh, now just to get past this and go out and breathe in some of the fresh, clean springtime air or whatever, right? I can't tell exactly what the assignment really means, but here's something you can try. Compile the following program and then go to a command prompt in the same directory that contains the executable. CPP / C++ / C Code:
Now, enter the program name. Suppose it's named test.exe: Code:
What happened? Now redirect the output to a file: Code:
What happened? Is there a file named "test_redirected.txt"? What is in the file? There may be a non-printing character in the file, so a text editor may or may not show what's there (depends on what editor you use). Maybe you have a hexadecimal editor or dump command on your system that lets you see what is in the file. Or maybe you can write a small C program to display the contents in hexadecimal (for extra credit???) Here's another test: CPP / C++ / C Code:
Try this with and without command line redirection. Interesting, huh? (Well, it's interesting to me, anyhow.) Regards, Dave |
|
#3
|
|||
|
|||
Re: Redirection within Microsoft Visual Studio.Net 2003Quote:
I wish! I had two language classes this semester and have to finish the second half of my Java class before I can take a break. But, I will have my Associates. Then just 12 short classes and I earn the big BS. Anyway, thanks for the reply. I e-mailed my instructor at the same time, and have yet to hear from him. Distance Learning/Self Study is a hard road because of this. It's a huge help to have avenues like this to help when you can't get it anywhere else. I haven't had a change to try your example - still doing the after work chores. But, I will in the next little bit. I'll let you know if I still have issues. Thanks again! |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Microsoft visual studio 6 | nadavsh | MS Visual C++ / MFC Forum | 0 | 05-Mar-2006 05:39 |
| Install prob. with MS Visual C++ 2003 on XP. | PeteGallo | MS Visual C++ / MFC Forum | 0 | 10-Feb-2006 19:28 |
| Visual Studio .NET 2003 problem in executing C source files | Debugger1 | C Programming Language | 14 | 04-Jun-2005 02:51 |
| Why my Visual Studio.Net doesn't have Windows Forms Application(.Net) template? Where | george | MS Visual C++ / MFC Forum | 9 | 18-Feb-2005 05:42 |
| What is "Ambigious symbol" ??*( a compilation error) | small_ticket | CPP / C++ Forum | 2 | 07-Jan-2005 21:10 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The