How to make a program that opens another program?

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 6470 Views - Last Post: 24 January 2012 - 09:37 AM Rate Topic: -----

#1 hokon86  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 06-December 10

How to make a program that opens another program?

Posted 06 December 2010 - 10:26 PM

Do some of you now how you can make a program that's open another program in dev-c++?;)
Is This A Good Question/Topic? 0
  • +

Replies To: How to make a program that opens another program?

#2 alias120  Icon User is offline

  • The Sum over All Paths
  • member icon

Reputation: 122
  • View blog
  • Posts: 700
  • Joined: 02-March 09

Re: How to make a program that opens another program?

Posted 06 December 2010 - 10:27 PM

Are you asking how to open files using a program written in C++?
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5061
  • View blog
  • Posts: 26,433
  • Joined: 10-May 07

Re: How to make a program that opens another program?

Posted 06 December 2010 - 10:32 PM

A program that can open a program...?

Do you mean a disassembler?

Which Operating System? What do you want the program to do once it's open? Launch it, read it, edit it?

The more information you can give us, the less we have to poke & prod.
Was This Post Helpful? 0
  • +
  • -

#4 hokon86  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 06-December 10

Re: How to make a program that opens another program?

Posted 06 December 2010 - 11:18 PM

I'm asking how to make a program that's open another file or program?;)
Was This Post Helpful? 0
  • +
  • -

#5 DaneAU  Icon User is offline

  • Great::Southern::Land
  • member icon

Reputation: 284
  • View blog
  • Posts: 1,615
  • Joined: 15-May 08

Re: How to make a program that opens another program?

Posted 06 December 2010 - 11:29 PM

i believe you may be thinking of executing or launching lets say the default browser or something to that effect.
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5061
  • View blog
  • Posts: 26,433
  • Joined: 10-May 07

Re: How to make a program that opens another program?

Posted 06 December 2010 - 11:35 PM

View Posthokon86, on 07 December 2010 - 12:18 AM, said:

I'm asking how to make a program that's open another file or program?;)

Please provide more detail.

For example.

Bad example
How to drive a car :
Step one, put car in drive
Step two, drive car.

Good example
How to drive a car :
Step one, locate keys
Step two, open car door
Step three, adjust mirrors
Step four, fasten seat belt
Step five, check mirrors for objects that are in direction you will move the car
Step six, insert keys into ignition
Step seven, turn ignition & listen for car to start engine
Step eight, if no objects, press on break, then use gear shifter to place car into drive (for forward) or reverse (for backwards).
... & so on...

We can't help you unless we can understand you. Please tell us what you are trying to do & we'll do our best.
Was This Post Helpful? 1
  • +
  • -

#7 hokon86  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 06-December 10

Re: How to make a program that opens another program?

Posted 06 December 2010 - 11:47 PM

What I have to write to make a program that's lunch another program;)
Was This Post Helpful? 0
  • +
  • -

#8 DaneAU  Icon User is offline

  • Great::Southern::Land
  • member icon

Reputation: 284
  • View blog
  • Posts: 1,615
  • Joined: 15-May 08

Re: How to make a program that opens another program?

Posted 07 December 2010 - 12:39 AM

If you are using windows, then this will be of use. For example launching the default web browser and opening a page may be done using

ShellExecute(NULL, "open", "http://www.dreamincode.net", NULL, NULL, SW_SHOWNORMAL);


Also using Related Topicsbeta you may have come across this thread, which also answers the same questions.

This post has been edited by DaneAU: 07 December 2010 - 12:46 AM

Was This Post Helpful? 0
  • +
  • -

#9 alias120  Icon User is offline

  • The Sum over All Paths
  • member icon

Reputation: 122
  • View blog
  • Posts: 700
  • Joined: 02-March 09

Re: How to make a program that opens another program?

Posted 07 December 2010 - 12:47 AM

View Posthokon86, on 06 December 2010 - 10:47 PM, said:

What I have to write to make a program that's lunch another program;)



Obviously you do not care for our advice, otherwise you would have elaborated on your actual problem as no2pencil suggested. Repeating an almost identical question three seperate times is not in any way helping us help you.
Was This Post Helpful? 0
  • +
  • -

#10 Gorian  Icon User is offline

  • ninja DIC
  • member icon

Reputation: 120
  • View blog
  • Posts: 1,681
  • Joined: 28-June 08

Re: How to make a program that opens another program?

Posted 07 December 2010 - 01:04 AM

View Posthokon86, on 06 December 2010 - 09:47 PM, said:

What I have to write to make a program that's lunch another program;)

mmmm.... lunch... omnomnomnom

wait... you didn't mean to ask for a program that lunches another program? :crazy:

depending on what you want (if you would follow the advice given, as no2pencil suggested, there wouldn't be a question) you could do a simple system call using system();, or for windows (of which a system call will also work) you can also use ShellExecute();, as DaneAU posted


I still like the idea of a program that makes me lunch....

This post has been edited by Gorian: 07 December 2010 - 01:05 AM

Was This Post Helpful? 1
  • +
  • -

#11 DaneAU  Icon User is offline

  • Great::Southern::Land
  • member icon

Reputation: 284
  • View blog
  • Posts: 1,615
  • Joined: 15-May 08

Re: How to make a program that opens another program?

Posted 07 December 2010 - 01:25 AM

Yea that would be good, if a program wrote itself and made lunch i think that could be even better ;)
Was This Post Helpful? 0
  • +
  • -

#12 no2pencil  Icon User is offline

  • Head MFIC
  • member icon

Reputation: 5061
  • View blog
  • Posts: 26,433
  • Joined: 10-May 07

Re: How to make a program that opens another program?

Posted 07 December 2010 - 01:33 AM

It could also be argued that the dudes car door is still open... oops!
Was This Post Helpful? 2
  • +
  • -

#13 Gorian  Icon User is offline

  • ninja DIC
  • member icon

Reputation: 120
  • View blog
  • Posts: 1,681
  • Joined: 28-June 08

Re: How to make a program that opens another program?

Posted 07 December 2010 - 01:51 AM

@OP: If English, is not your first language, I do want to say, my point is not to make fun of that, but rather to bring to light the fact that you will get better responses if you attempt to use proper grammar and spelling (for which spell check is always good :) )

Also, people are less likely to help you, and offer advice to solve the problem you want help with if they can't understand what the problem is, and you don't show an inclination to follow the advice that they do give. Should this change, you will garner better responses from us, and less people would make jokes relating to your posts (unless you are in the lounge ;) )

EDIT: Spelling :P

This post has been edited by Gorian: 07 December 2010 - 01:55 PM

Was This Post Helpful? 2
  • +
  • -

#14 GoldOnFire  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-January 12

Re: How to make a program that opens another program?

Posted 24 January 2012 - 09:00 AM

hey im portuguese and im new to programing and i made this program but it gives me this error that i cant fix:

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <iostream>
#include <string>
#include <windows.h>

main()
{
      int op1 ,op2;
      printf("\t\t---------------Menu---------------\n");
      printf("\t\t\t 1-> ficha 1. \n");
      printf("\t\t\t 2-> ficha 2. \n");
      printf("\t\t\t 3-> ficha 3. \n");
      printf("\t\t\t 4-> ficha 4. \n");
      printf("\t\t\t 5-> ficha 5. \n");
      printf("\t\t\t 6-> ficha 6. \n");
      printf("\t\t\t 7-> ficha 7. \n");
      printf("\t\t\t 8-> ficha 8. \n");
      printf("\t\t\t 0-> Sair. \n");
      scanf(" %d", &op1);
      switch (op1)
      {
           case 1:printf("\t\t-----------MenuFicha1----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path0[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex1.exe\"";
        system(path0);break;
      case 2:char path1[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex2.exe\"";
        system(path1);break;
      case 3:char path2[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex3.exe\"";
        system(path2);break;
      case 4:char path3[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex4.exe\"";
        system(path3);break;
      case 5:char path4[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex5.exe\"";
        system(path4);break;
      case 6:char path5[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex6.exe\"";
        system(path5);break;
      case 7:char path6[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex7.exe\"";
        system(path6);break;break;}
           case 2:printf("\t\t-----------MenuFicha2----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path7[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex1.exe\"";
        system(path7);break;
      case 2:char path8[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex2.exe\"";
        system(path8);break;
      case 3:char path9[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex3.exe\"";
        system(path9);break;
      case 4:char path10[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex4.exe\"";
        system(path10);break;
      case 5:char path11[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex5.exe\"";
        system(path11);break;
      case 6:char path12[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex6.exe\"";
        system(path12);break;
      case 7:char path13[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex7.exe\"";
        system(path13);break;
        case 8:char path14[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex8.exe\"";
        system(path14);break;break;}
           case 3:printf("\t\t-----------MenuFicha3----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path15[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex1.exe\"";
        system(path15);break;
      case 2:char path16[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex2.exe\"";
        system(path16);break;
      case 3:char path17[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex3.exe\"";
        system(path17);break;
      case 4:char path18[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex4.exe\"";
        system(path18);break;
      case 5:char path19[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex5.exe\"";
        system(path19);break;break;}
           case 4:printf("\t\t-----------MenuFicha4----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path20[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex1.exe\"";
        system(path20);break;
      case 2:char path21[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex2.exe\"";
        system(path21);break;
      case 3:char path22[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex3.exe\"";
        system(path22);break;
      case 4:char path23[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex4.exe\"";
        system(path23);break;
      case 5:char path24[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex5.exe\"";
        system(path24);break;
      case 6:char path25[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex6.exe\"";
        system(path25);break;
      case 7:char path26[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex7.exe\"";
        system(path26);break;break;}
           case 5:printf("\t\t-----------MenuFicha5----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path27[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex1.exe\"";
        system(path27);break;
      case 2:char path28[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex2.exe\"";
        system(path28);break;
      case 3:char path29[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex3.exe\"";
        system(path29);break;
      case 4:char path30[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex4.exe\"";
        system(path30);break;
      case 5:char path31[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex5.exe\"";
        system(path31);break;break;}
           case 6:printf("\t\t-----------MenuFicha6----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      printf("\t\t\t 9-> ex 9. \n");
      printf("\t\t\t 10-> ex 10. \n");
      printf("\t\t\t 11-> ex 11. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path32[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex1.exe\"";
        system(path32);break;
      case 2:char path33[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex2.exe\"";
        system(path33);break;
      case 3:char path34[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex3.exe\"";
        system(path34);break;
      case 4:char path35[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex4.exe\"";
        system(path35);break;
      case 5:char path36[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex5.exe\"";
        system(path36);break;
      case 6:char path37[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex6.exe\"";
        system(path37);break;
      case 7:char path38[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex7.exe\"";
        system(path38);break;
        case 8:char path39[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex8.exe\"";
        system(path39);break;
         case 9:char path40[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex9.exe\"";
        system(path40);break;
         case 10:char path41[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex10.exe\"";
        system(path41);break;
         case 11:char path42[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex11.exe\"";
        system(path42);break;break;}
           case 7:printf("\t\t-----------MenuFicha7----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path43[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex1.exe\"";
        system(path43);break;
      case 2:char path44[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex2.exe\"";
        system(path44);break;
      case 3:char path45[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex3.exe\"";
        system(path45);break;
      case 4:char path46[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex4.exe\"";
        system(path46);break;
      case 5:char path47[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex5.exe\"";
        system(path47);break;
      case 6:char path48[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex6.exe\"";
        system(path48);break;
      case 7:char path49[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex7.exe\"";
        system(path49);break;break;}
           case 8:printf("\t\t-----------MenuFicha8----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path50[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex1.exe\"";
        system(path50);break;
      case 2:char path51[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex2.exe\"";
        system(path51);break;
      case 3:char path52[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex3.exe\"";
        system(path52);break;
      case 4:char path53[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex4.exe\"";
        system(path53);break;
      case 5:char path54[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex5.exe\"";
        system(path54);break;break;}
             }
        system("pause");  
      }



its giving me next error:
37 C:\Users\David\Desktop\Escola\PSI\ex\Fzer.cpp jump to case label
35 C:\Users\David\Desktop\Escola\PSI\ex\Fzer.cpp crosses initialization of `char path0[52]'



it gives me this kinda error lots of times.

im using dev c++4.9.9.2 .

hope u can help :D
Was This Post Helpful? 0
  • +
  • -

#15 kevindckr  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 105
  • Joined: 09-January 12

Re: How to make a program that opens another program?

Posted 24 January 2012 - 09:13 AM

View PostGoldOnFire, on 24 January 2012 - 09:00 AM, said:

hey im portuguese and im new to programing and i made this program but it gives me this error that i cant fix:

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <iostream>
#include <string>
#include <windows.h>

main()
{
      int op1 ,op2;
      printf("\t\t---------------Menu---------------\n");
      printf("\t\t\t 1-> ficha 1. \n");
      printf("\t\t\t 2-> ficha 2. \n");
      printf("\t\t\t 3-> ficha 3. \n");
      printf("\t\t\t 4-> ficha 4. \n");
      printf("\t\t\t 5-> ficha 5. \n");
      printf("\t\t\t 6-> ficha 6. \n");
      printf("\t\t\t 7-> ficha 7. \n");
      printf("\t\t\t 8-> ficha 8. \n");
      printf("\t\t\t 0-> Sair. \n");
      scanf(" %d", &op1);
      switch (op1)
      {
           case 1:printf("\t\t-----------MenuFicha1----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path0[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex1.exe\"";
        system(path0);break;
      case 2:char path1[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex2.exe\"";
        system(path1);break;
      case 3:char path2[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex3.exe\"";
        system(path2);break;
      case 4:char path3[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex4.exe\"";
        system(path3);break;
      case 5:char path4[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex5.exe\"";
        system(path4);break;
      case 6:char path5[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex6.exe\"";
        system(path5);break;
      case 7:char path6[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 1\\ex7.exe\"";
        system(path6);break;break;}
           case 2:printf("\t\t-----------MenuFicha2----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path7[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex1.exe\"";
        system(path7);break;
      case 2:char path8[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex2.exe\"";
        system(path8);break;
      case 3:char path9[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex3.exe\"";
        system(path9);break;
      case 4:char path10[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex4.exe\"";
        system(path10);break;
      case 5:char path11[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex5.exe\"";
        system(path11);break;
      case 6:char path12[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex6.exe\"";
        system(path12);break;
      case 7:char path13[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex7.exe\"";
        system(path13);break;
        case 8:char path14[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 2\\ex8.exe\"";
        system(path14);break;break;}
           case 3:printf("\t\t-----------MenuFicha3----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path15[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex1.exe\"";
        system(path15);break;
      case 2:char path16[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex2.exe\"";
        system(path16);break;
      case 3:char path17[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex3.exe\"";
        system(path17);break;
      case 4:char path18[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex4.exe\"";
        system(path18);break;
      case 5:char path19[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 3\\ex5.exe\"";
        system(path19);break;break;}
           case 4:printf("\t\t-----------MenuFicha4----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path20[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex1.exe\"";
        system(path20);break;
      case 2:char path21[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex2.exe\"";
        system(path21);break;
      case 3:char path22[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex3.exe\"";
        system(path22);break;
      case 4:char path23[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex4.exe\"";
        system(path23);break;
      case 5:char path24[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex5.exe\"";
        system(path24);break;
      case 6:char path25[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex6.exe\"";
        system(path25);break;
      case 7:char path26[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 4\\ex7.exe\"";
        system(path26);break;break;}
           case 5:printf("\t\t-----------MenuFicha5----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path27[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex1.exe\"";
        system(path27);break;
      case 2:char path28[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex2.exe\"";
        system(path28);break;
      case 3:char path29[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex3.exe\"";
        system(path29);break;
      case 4:char path30[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex4.exe\"";
        system(path30);break;
      case 5:char path31[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 5\\ex5.exe\"";
        system(path31);break;break;}
           case 6:printf("\t\t-----------MenuFicha6----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      printf("\t\t\t 9-> ex 9. \n");
      printf("\t\t\t 10-> ex 10. \n");
      printf("\t\t\t 11-> ex 11. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path32[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex1.exe\"";
        system(path32);break;
      case 2:char path33[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex2.exe\"";
        system(path33);break;
      case 3:char path34[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex3.exe\"";
        system(path34);break;
      case 4:char path35[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex4.exe\"";
        system(path35);break;
      case 5:char path36[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex5.exe\"";
        system(path36);break;
      case 6:char path37[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex6.exe\"";
        system(path37);break;
      case 7:char path38[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex7.exe\"";
        system(path38);break;
        case 8:char path39[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex8.exe\"";
        system(path39);break;
         case 9:char path40[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex9.exe\"";
        system(path40);break;
         case 10:char path41[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex10.exe\"";
        system(path41);break;
         case 11:char path42[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 6\\ex11.exe\"";
        system(path42);break;break;}
           case 7:printf("\t\t-----------MenuFicha7----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path43[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex1.exe\"";
        system(path43);break;
      case 2:char path44[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex2.exe\"";
        system(path44);break;
      case 3:char path45[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex3.exe\"";
        system(path45);break;
      case 4:char path46[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex4.exe\"";
        system(path46);break;
      case 5:char path47[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex5.exe\"";
        system(path47);break;
      case 6:char path48[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex6.exe\"";
        system(path48);break;
      case 7:char path49[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 7\\ex7.exe\"";
        system(path49);break;break;}
           case 8:printf("\t\t-----------MenuFicha8----------\n");
      printf("\t\t\t 1-> ex 1. \n");
      printf("\t\t\t 2-> ex 2. \n");
      printf("\t\t\t 3-> ex 3. \n");
      printf("\t\t\t 4-> ex 4. \n");
      printf("\t\t\t 5-> ex 5. \n");
      printf("\t\t\t 6-> ex 6. \n");
      printf("\t\t\t 7-> ex 7. \n");
      printf("\t\t\t 8-> ex 8. \n");
      scanf(" %d", &op2);
      switch (op2)
      {
      case 1:char path50[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex1.exe\"";
        system(path50);break;
      case 2:char path51[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex2.exe\"";
        system(path51);break;
      case 3:char path52[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex3.exe\"";
        system(path52);break;
      case 4:char path53[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex4.exe\"";
        system(path53);break;
      case 5:char path54[] = "\"C:\\Users\\David\\Desktop\\Escola\\PSI\\ficha 8\\ex5.exe\"";
        system(path54);break;break;}
             }
        system("pause");  
      }



its giving me next error:
37 C:\Users\David\Desktop\Escola\PSI\ex\Fzer.cpp jump to case label
35 C:\Users\David\Desktop\Escola\PSI\ex\Fzer.cpp crosses initialization of `char path0[52]'



it gives me this kinda error lots of times.

im using dev c++4.9.9.2 .

hope u can help :D



I just puked.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2