|
From: Noorez K. <coo...@ho...> - 2004-05-21 22:34:14
|
There are lines skipping in my program. I have marked them with comments
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(int args, char* pszArgs[])
{
if(strcmp(pszArgs[1],"-nt")== 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)
{
choice = 0;
cout << "\nEnter the number of your choice: ";
cin >> choice;
if(choice == 0)
{
cout << "Exiting easy opener...\n";
//Sleep(1000);
return 0;
}
if(choice == 1)
{
system("start winword");
}
if(choice ==2)
{
system("mspaint");
}
if(choice ==3)
{
//should beable to...
system("calc");
}
if(choice ==4)
{
char site[123];
char intern[] ="start iexplore ";
cout << "Enter site: ";
cin.getline(site,123); /*this line skips*/
strcat(intern,site);
system(intern);
//delete site;
}
}//while
}//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;
if(choice ==0)
{
cout << "Exiting Easy Opener..\n";
//Sleep(1000);
return 0;
}
if(choice ==1)
{
system("start winword");
}
if(choice==2)
{
system("pbrush");
}
if(choice==3)
{
system("calc");
}
if(choice ==4)
{
cout << "Enter site: ";
char site[235];
char intern[]="start iexplore ";
cin.getline(site,123);/*this line skips*/
strcat(intern,site);
system(intern);
}
}
}
return 0;
}
_________________________________________________________________
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|