|
From: Noorez K. <coo...@ho...> - 2004-05-28 02:26:58
|
something is wrong with the both the switch statements.
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(int args, char* pszArgs[])//there needs to be args for this to work
{
if(strcmp(pszArgs[1],"-nt")== 0)
{
system("cls");//start with a clear screen
//explain what the heck all this does
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{//while
choice = 0;
cout << "\nEnter the number of your choice: ";
cin >> choice;
switch(choice)
{//switch
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("mspaint");
break;
case 3:
system("calc");
break;
case 4:
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin >> site;
strcat(intern,site);
system(intern);
break;
default://the choice wasn't a valid one if we are at default
cout << "Not a valid choice\n";
}//switch
}//end while
}//done defining nt operating system
if(strcmp(pszArgs[1],"-me")==0)
{
system("cls");
cout << "Welcome to the easy program opener!\n";
cout << "Hear is a list of programs that can be easy opened\n\n";
cout << "To quit enter 0 or nothing for a program choice\n";
cout << "1. Microsoft Office\n";
cout << "2. Microsoft Paint\n";
cout << "3. Calculator\n";
cout << "4. Internet Explorer\n";
int choice;
while(1)
{
cout << endl << "Enter choice: ";
cin >> choice;
switch(choice)
{
case 0:
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
break;
case 1:
system("start winword");
break;
case 2:
system("pbrush");
break;
case 3:
system("calc");
break;
case 4:
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin >> site;
strcat(intern,site);
system(intern);
break;
default:
cout << "Not a valid choice\n";
}//end switch
}//end while
}//end defining me operating system
if(strcmp(pszArgs[1],NULL)==0 )//opps! nothing found!
{
cout << "This program requries the use of Args\n"
<< "Use the name of your operating system\n"
<< "eg... -me for Millenium Edition\n\n";
cout << "Open a command prompt window and type pszArgs[0] -<short name
of system>";
cout << "Just don't use the << ";
system("pause");
return 1;
}
return 0;//exit program
}
_________________________________________________________________
MSN Premium with Virus Guard and Firewall* from McAfee® Security : 2 months
FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|
|
From: Jorge A. <jor...@ep...> - 2004-05-28 14:43:25
|
A clue: is the same '1' than 1?, are you sure?
Noorez Kassam escribi=F3:
> something is wrong with the both the switch statements.
>
> #include <iostream>
> #include <cstdlib>
> #include <string>
> using namespace std;
>
> int main(int args, char* pszArgs[])//there needs to be args for this=20
> to work
> {
> if(strcmp(pszArgs[1],"-nt")=3D=3D 0)
> {
> system("cls");//start with a clear screen
> //explain what the heck all this does
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {//while
>
> choice =3D 0;
> cout << "\nEnter the number of your choice: ";
> cin >> choice;
> switch(choice)
> {//switch
> case 0:
>
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("mspaint");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
> char site[123];
> char intern[] =3D"start iexplore ";
> cout << "Enter site: ";
> cin >> site;
> strcat(intern,site);
> system(intern);
> break;
>
> default://the choice wasn't a valid one if we are at default
> cout << "Not a valid choice\n";
> }//switch
>
> }//end while
> }//done defining nt operating system
>
> if(strcmp(pszArgs[1],"-me")=3D=3D0)
> {
> system("cls");
> cout << "Welcome to the easy program opener!\n";
> cout << "Hear is a list of programs that can be easy opened\n\n";
> cout << "To quit enter 0 or nothing for a program choice\n";
>
> cout << "1. Microsoft Office\n";
> cout << "2. Microsoft Paint\n";
> cout << "3. Calculator\n";
> cout << "4. Internet Explorer\n";
>
> int choice;
> while(1)
> {
> cout << endl << "Enter choice: ";
> cin >> choice;
> switch(choice)
> {
> case 0:
> cout << "Exiting easy opener...\n";
> //Sleep(1000);
> return 0;
> break;
>
> case 1:
> system("start winword");
> break;
>
> case 2:
> system("pbrush");
> break;
>
> case 3:
> system("calc");
> break;
>
> case 4:
>
> char site[123];
> char intern[] =3D"start iexplore ";
> cout << "Enter site: ";
> cin >> site;
> strcat(intern,site);
> system(intern);
> break;
>
> default:
> cout << "Not a valid choice\n";
> }//end switch
>
> }//end while
>
> }//end defining me operating system
>
> if(strcmp(pszArgs[1],NULL)=3D=3D0 )//opps! nothing found!
> {
> cout << "This program requries the use of Args\n"
> << "Use the name of your operating system\n"
> << "eg... -me for Millenium Edition\n\n";
>
> cout << "Open a command prompt window and type pszArgs[0] -<short=20
> name of system>";
> cout << "Just don't use the << ";
>
> system("pause");
> return 1;
> }
>
> return 0;//exit program
> }
>
> _________________________________________________________________
> MSN Premium with Virus Guard and Firewall* from McAfee=AE Security : 2=20
> months FREE* =20
> http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=3D=
1034&SU=3Dhttp://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines=20
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle=20
> 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Jorge A. <jor...@ep...> - 2004-05-28 14:51:23
|
Oppsss!, I miss the point.. I feel stupid :-(
Jorge Alzate escribi=F3:
> A clue: is the same '1' than 1?, are you sure?
>
> Noorez Kassam escribi=F3:
>
>> something is wrong with the both the switch statements.
>>
>> #include <iostream>
>> #include <cstdlib>
>> #include <string>
>> using namespace std;
>>
>> int main(int args, char* pszArgs[])//there needs to be args for this=20
>> to work
>> {
>> if(strcmp(pszArgs[1],"-nt")=3D=3D 0)
>> {
>> system("cls");//start with a clear screen
>> //explain what the heck all this does
>> cout << "Welcome to the easy program opener!\n";
>> cout << "Hear is a list of programs that can be easy opened\n\n";
>> cout << "To quit enter 0 or nothing for a program choice\n";
>>
>> cout << "1. Microsoft Office\n";
>> cout << "2. Microsoft Paint\n";
>> cout << "3. Calculator\n";
>> cout << "4. Internet Explorer\n";
>>
>> int choice;
>> while(1)
>> {//while
>>
>> choice =3D 0;
>> cout << "\nEnter the number of your choice: ";
>> cin >> choice;
>> switch(choice)
>> {//switch
>> case 0:
>>
>> cout << "Exiting easy opener...\n";
>> //Sleep(1000);
>> return 0;
>> break;
>>
>> case 1:
>> system("start winword");
>> break;
>>
>> case 2:
>> system("mspaint");
>> break;
>>
>> case 3:
>> system("calc");
>> break;
>>
>> case 4:
>> char site[123];
>> char intern[] =3D"start iexplore ";
>> cout << "Enter site: ";
>> cin >> site;
>> strcat(intern,site);
>> system(intern);
>> break;
>>
>> default://the choice wasn't a valid one if we are at default
>> cout << "Not a valid choice\n";
>> }//switch
>>
>> }//end while
>> }//done defining nt operating system
>>
>> if(strcmp(pszArgs[1],"-me")=3D=3D0)
>> {
>> system("cls");
>> cout << "Welcome to the easy program opener!\n";
>> cout << "Hear is a list of programs that can be easy opened\n\n";
>> cout << "To quit enter 0 or nothing for a program choice\n";
>>
>> cout << "1. Microsoft Office\n";
>> cout << "2. Microsoft Paint\n";
>> cout << "3. Calculator\n";
>> cout << "4. Internet Explorer\n";
>>
>> int choice;
>> while(1)
>> {
>> cout << endl << "Enter choice: ";
>> cin >> choice;
>> switch(choice)
>> {
>> case 0:
>> cout << "Exiting easy opener...\n";
>> //Sleep(1000);
>> return 0;
>> break;
>>
>> case 1:
>> system("start winword");
>> break;
>>
>> case 2:
>> system("pbrush");
>> break;
>>
>> case 3:
>> system("calc");
>> break;
>>
>> case 4:
>>
>> char site[123];
>> char intern[] =3D"start iexplore ";
>> cout << "Enter site: ";
>> cin >> site;
>> strcat(intern,site);
>> system(intern);
>> break;
>>
>> default:
>> cout << "Not a valid choice\n";
>> }//end switch
>>
>> }//end while
>>
>> }//end defining me operating system
>>
>> if(strcmp(pszArgs[1],NULL)=3D=3D0 )//opps! nothing found!
>> {
>> cout << "This program requries the use of Args\n"
>> << "Use the name of your operating system\n"
>> << "eg... -me for Millenium Edition\n\n";
>>
>> cout << "Open a command prompt window and type pszArgs[0] -<short=20
>> name of system>";
>> cout << "Just don't use the << ";
>>
>> system("pause");
>> return 1;
>> }
>>
>> return 0;//exit program
>> }
>>
>> _________________________________________________________________
>> MSN Premium with Virus Guard and Firewall* from McAfee=AE Security : 2=
=20
>> months FREE* =20
>> http://join.msn.com/?pgmarket=3Den-ca&page=3Dbyoa/prem&xAPID=3D1994&DI=
=3D1034&SU=3Dhttp://hotmail.com/enca&HL=3DMarket_MSNIS_Taglines=20
>>
>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: Oracle 10g
>> Get certified on the hottest thing ever to hit the market... Oracle=20
>> 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
>> http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
>> _______________________________________________
>> Dev-cpp-users mailing list
>> Dev...@li...
>> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>
>
|