LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-01-2006, 04:18 PM   #1
safrout
Member
 
Registered: Mar 2002
Location: egypt
Distribution: Gentoo
Posts: 457

Rep: Reputation: 30
URGENT small help for a C noob


i just need to know the command i need to do the following, i am making a c prg called main menu which when run give the user a menu of 4 choices to choose between other 4 prgs located in the same folder and to run the one the user will choose

i just need to know the command to run those prg and then exit the main menu prg

suppsong that the files r located under folder named OR on a floppy drive I.E a:\OR\...
and the files are named cpm.bas , pert.bas, srm.bas

Code:
#include <stdio.h>
#include <conio.h>
#include <stlib.h>
 int main()
{
    char choice;
    printf("**************************************************************\n");
    printf("*                                        sadat academy       *\n");
    printf("*                                     computer department    *\n");
    printf("*                                   ***********************  *\n");
    printf("*                                                            *\n");
    printf("*                                                            *\n");
    printf("*                   main menu                                *\n");
    printf("*           ****************************                     *\n");
    printf("*           *                          *                     *\n");
    printf("*           * (1) shortest route model *                     *\n");
    printf("*           * (2) critical path model  *                     *\n");
    printf("*           * (3) pert model           *                     *\n");
    printf("*           * (4) exit                 *                     *\n");
    printf("*           *                          *                     *\n");
    printf("*           ****************************                     *\n");
    printf("*                                                            *\n");
    printf("*                                                            *\n");
    printf("*                                                            *\n");
    printf("*                                                            *\n");
    printf("**************************************************************\n");
    printf("enter your choice of the following\n");
    printf("1. shortest route model\n");
    printf("2. critical path model\n");
    printf("3. pert model\n");
    printf("4. exit\n");
    choice = getch();
    switch (choice)
    {
        case 1 :
            ??????????????????
        case 2 :
            ???????????????????
        case 3 :
            ???????????????????
        case 4 :
            ???????????????????
        defult :
            printf("error please enter 1,2,3,or4");
        }
        return 0;
        getch();
  }
 
Old 01-01-2006, 07:32 PM   #2
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
To run a program on the computer inside so to speeak your program you use the system function call.


to run things locally in the same folder would be system dependent.



man system for more details.
 
Old 01-01-2006, 10:24 PM   #3
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Most threads have to do with Linux-related questions. Your question here seems to be for a DOS system; is that correct? That's ok, i'm just wondering if there really are other old DOS dinosaurs out there besides myself. And if this is so, you would want to use one of the exec function calls, for example:
Code:
 
case '1': 
    execl("gwbasic","a:\or\srm.bas",NULL);
    break;
(If this is not a DOS question, please disregard this irrelevant post.)

Quote:
Do whatever he tells you.
- Mary of Nazareth

Last edited by dogpatch; 01-01-2006 at 10:30 PM.
 
Old 01-02-2006, 07:54 AM   #4
safrout
Member
 
Registered: Mar 2002
Location: egypt
Distribution: Gentoo
Posts: 457

Original Poster
Rep: Reputation: 30
ya it is DOs related

thank very much

i asked here cause this was an ass. i have to do for the OR prof

thanks again very much
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
boot sector and lilo collapse !!!!! URGENT URGENT URGEN !!!!! frelihm Linux - Software 21 12-02-2009 10:21 AM
Urgent Question Regarding Urgent Questions! Need Help Now! Crashed_Again LQ Suggestions & Feedback 11 10-17-2007 08:07 PM
Linux super noob questions(very urgent) lolz Fedora 19 10-23-2005 09:39 PM
Firewall help (noob really really huge noob) ProtoformX Linux - Networking 1 03-29-2004 12:19 AM
Urgent Urgent !!!! Mozilla Keeps All Your Deleted Emails !!!! odin123 Linux - Software 2 01-31-2004 02:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration