![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| redirection | DNAx86 | Shell Programming and Scripting | 9 | 04-18-2008 11:24 AM |
| sed redirection | myle | UNIX for Dummies Questions & Answers | 3 | 03-12-2008 04:04 PM |
| csh stderr redirection | jolok | Shell Programming and Scripting | 0 | 04-15-2005 07:03 AM |
| I/O redirection within a coprocess | Mugin | Shell Programming and Scripting | 4 | 10-21-2003 05:17 AM |
| redirection to tty** with cat | zorro | UNIX for Dummies Questions & Answers | 1 | 11-02-2001 08:23 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Here is my problem. I don't know make this redirection thing work. The output file (called output.c) looks like this
#include<stdio.h> int main() { int k; int m; print f("%d\n", k); printf("%d\n", m); return 0; } the input file(called input.c) is this #include<stdio.h> int main() { int k; int m; k=5; m=4; return 0; } I then compile the output file and do a.out<input and it does not print 5 and 4, it prints some jumble of numbers. Please help! Shallon1 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
__________________
Not quite as cool as all the other Kids... |
|
#3
|
|||
|
|||
|
Hi!
What exactly are you trying to do??? From what I've understood, you are trying to pass the values 5 and 4 from the file input to the file output. If this is what you are trying to do, your files should look like: input: ====== 5 4 output.c ======= #include < stdio.h > int main() { int k; int m; scanf("%d", &k); scanf("%d", &m); printf(" %d, %d\n", k, m); return 0; } ofcourse, you can go about with your C Programs also by modifying your input.c file to "printf()" 'k' and 'm' and your output.c should be like the code pasted above, but you'll have to use pipes: input | output and just one more thing, check your uninitialized variables!!! Regards SHAIK Last edited by shaik786; 12-12-2001 at 05:00 AM. |
|||
| Google The UNIX and Linux Forums |