473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

spawnvp does not work

I wrote that program but spawnvp dows not call the exe files hello1,hello2!!!

#include <stdio.h>
#include <conio.h>
#include <process.h>

//Tv Rental system menu version 1
int user_selection();
void display_menu();
void call_program(int option,char *argv[]);
int main(int ,char *argv[])
{
int option;
do
{
display_menu();
option=user_selection();
if (option!=7) //Exit
call_program(option,argv);
}
while (option!=7);
return 0;
}
void display_menu()
{
clrscr();
printf("1 hello1");
printf("\n2 hello2");
printf("\n3 exit");
}

int user_selection()
{
int opt;
printf("\n Enter required option(1-3) : ");
scanf("%1d",&opt);
return (opt);
}

void call_program(int opt,char *argv[])
{
void delay();
switch(opt)
{
case 1:
spawnvp(0,"hello1.exe",argv);
delay();
break;
case 2:
spawnvp(0,"hello2.exe",argv);
delay();
break;
default:
printf("\n incoreect input");
delay();
exit(0);
}
}
void delay()
{
int i;
for (i=0;i<20000;i++);
}
Jul 22 '05 #1
3 2310
hp******@yahoo.com <eh***********@yahoo.com> spoke thus:
I wrote that program but spawnvp dows not call the exe files hello1,hello2!!! #include <stdio.h>
#include <conio.h>
#include <process.h>


(Unless someone else finds an on-topic answer...)

Your post is off-topic for comp.lang.c++. Please visit

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

for posting guidelines and frequently asked questions. Thank you.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #2
eh***********@yahoo.com (hp******@yahoo.com) wrote in message news:<7e**************************@posting.google. com>...
I wrote that program but spawnvp dows not call the exe files hello1,hello2!!!
[redacted]


What is this spawnvp of which you speak? It's not in my copy of the standard.

Try a windows specific newsgroup.
Jul 22 '05 #3
Did you try debugging and see what is happenning? Is the value you expect
getting to the switch statement? Do you get any error messags? You asked
this before, and I made these comments (and others) then. It was also
suggested that you ask in a newsgroup that knows what the heck spawnvp is.
The suggestions still stand.

-Howard
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
5
by: me | last post by:
I have a Class Library that contains a Form and several helper classes. A thread gets created that performs processing of data behind the scenes and the Form never gets displayed (it is for debug...
2
by: hpy_awad | last post by:
#include <stdio.h> #include <conio.h> #include <process.h> //Tv Rental system menu version 1 int user_selection(); void display_menu(); void call_program(int option,char *argv); int main(int...
2
by: hpy_awad | last post by:
I wrote that program but spawnvp dows not call the exe files hello1,hello2!!! #include <stdio.h> #include <conio.h> #include <process.h> //Tv Rental system menu version 1 int...
22
by: Robert Bralic | last post by:
CAN anybody tell me any address where I can download some small(1000-2000) lines C++ proghram source. Or send me ,a small(1000-2000) lines C++ program source that I can compille with gpp under...
12
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now...
0
by: Jarod_24 | last post by:
How does tabindex work in ASP .net pages I dosen't seem to work quite like in regular forms. and there isn't any TabStop property either. 1 .How do you prevent a control form beign "tabbed"....
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
14
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src=""...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.