see. i am making my own "siri" type of thing, its really simple, if i type in open weather, a link to a weather site opens, but when i type in open weather, the website dosent open, so i made a else statement to see if the program is bugging or not working, as it turns out its not working, what am i doing wrong?
#include <iostream>
#include <Windows.h>
#include <string>
usingnamespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main()
{
//----------------------------------------------------------CMDS
int cmd = 0;
//----------------------------------------------------------URLs
string weather = "https://www.weather.com/"; //url
//----------------------------------------------------------inputs
char input[32];
cout << "Hi i am your new and own assistent, my name is alex\n";
Sleep (2000);
cout << "i am pritty new, so youll have to write in commands for now\n";
cin >> input ;
if (input == "open weather"){
ShellExecute(NULL, "open", weather.c_str(), NULL, NULL, SW_SHOWNORMAL);
}
else {
cout << "fail\n";
}
return 0;
}
#include <iostream>
#include <Windows.h>
#include <string>
usingnamespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main()
{
//----------------------------------------------------------CMDS
int cmd = 0;
//----------------------------------------------------------URLs
string weather = "https://www.weather.com/"; //url
//----------------------------------------------------------inputs
string input;
cout << "Hi i am your new and own assistent, my name is alex\n";
Sleep (2000);
cout << "i am pritty new, so youll have to write in commands for now\n";
cin >> input ;
if (input == "open weather"){
ShellExecute(NULL, "open", weather.c_str(), NULL, NULL, SW_SHOWNORMAL);
}
else {
cout << "fail\n";
}
return 0;
}
#include <iostream>
#include <Windows.h>
#include <string>
usingnamespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main()
{
//----------------------------------------------------------CMDS
int cmd = 0;
//----------------------------------------------------------URLs
string weather = "https://www.weather.com/"; //url
//----------------------------------------------------------inputs
string input;
cout << "Hi i am your new and own assistent, my name is alex\n";
Sleep (2000);
cout << "i am pritty new, so youll have to write in commands for now\n";
getline(cin, input);
if (input == "open weather"){
ShellExecute(NULL, "open", weather.c_str(), NULL, NULL, SW_SHOWNORMAL);
}
return 0;
}