![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C++ map program - Error message | dhanamurthy | High Level Programming | 0 | 04-02-2008 07:57 PM |
| Error in AWK Program | bikas_jena | Shell Programming and Scripting | 3 | 01-07-2008 02:30 PM |
| Program Error | Carmen123 | AIX | 0 | 11-23-2006 07:20 AM |
| unix - c program sending error from DB to email | chino_52284 | Shell Programming and Scripting | 2 | 04-28-2005 09:12 PM |
| Error Compiling C program | Vivek | High Level Programming | 3 | 10-25-2001 12:13 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
little program error.
I am trying to work this little program, its not working..
Code:
int main()
{
FILE *fp;
char *args[40];
pid_t child, exited_pid;
int status = 0;
*args[0] = "less";
fp = popen("ls", "r");
child = fork();
if(child == 0)
{
dup2(fp->fd, 0);
if(execvp(args[0], args) == -1)
{
printf("error");
exit(EXIT_FAILURE);
}
wait(&status);
wait(&status);
}
I got error. Warning: assignment makes integer from pointer without a cast Error: 'FILE' has no member named 'fd' Error: expected declaration or statement at end of input. My whole goal of the program is to execute ls, and read from that program & store it in the buffer. Then my second program (argss[0]) reads the input coming from there and uses it... help plz ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|