samedi 28 février 2015

C++ How To open an application using Text Input and If Statements

I'm trying to make a simple application launcher using C++.


I have looked online and i can't find a specific answer i have found multiple questions and items that i have pieced together to make something but i can't get it to work, can anyone help?



#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
int textin;
cin >> textin;
if ( textin == "ATLauncher" )
{
system("C:\Users\NAME\Main\minecraftlaunchers\AtLauncher\ATLauncher.exe");
system ("pause");
return 0;
}
}


Error msgs that appear when using Dev C++ 9 17 C:\Users\Andrew\Desktop\ProgramLauncher.cpp [Error] ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 11 C:\Users\Andrew\Desktop\ProgramLauncher.cpp [Error] incomplete universal character name \U 10 11 C:\Users\Andrew\Desktop\ProgramLauncher.cpp [Warning] unknown escape sequence: '\A' [enabled by default] 10 11 C:\Users\Andrew\Desktop\ProgramLauncher.cpp [Warning] unknown escape sequence: '\M' [enabled by default] 10 11 C:\Users\Andrew\Desktop\ProgramLauncher.cpp [Warning] unknown escape sequence: '\m' [enabled by default] 10 11 C:\Users\Andrew\Desktop\ProgramLauncher.cpp [Warning] unknown escape sequence: '\A' [enabled by default] 10 11 C:\Users\Andrew\Desktop\ProgramLauncher.cpp [Warning] unknown escape sequence: '\A' [enabled by default]


(Feel Free to inprove this I suck at anything thats not HTML5)


Aucun commentaire:

Enregistrer un commentaire