Visual Studio beim ausführen Fehlermeldung?



  • Hallo, ich habe ein ganz einfaches Bestellprogramm geschrieben, welches natürlich nicht bestellt oder irgendwas ausführt, da ich seit einem Tag C++ lerne.
    Nun... Ich habe mir Visual Studio Enterprise gekauft, aber wenn ich den Code ausführe, kommt diese Fehlermeldung:
    https://prnt.sc/wbi22g
    Wenn ich den Code in Online-Compiler ausführe, funktioniert alles wunderbar.
    Hier mein Code:

    #include <iostream>
    int main() {
    	int excistance[3] = { 4, 19, 0 };
    	int input;
    	int order_value;
    	std::cout << "Enter the article number: ";
    	std::cin >> input;
    	std::cout << "Enter the value you wish to order: ";
    	std::cin >> order_value;
    	if (excistance[input] == 0) {
    		std::cout << "Caution: No products available! Please contact the Support" << std::endl;
    
    	}
    	else if (excistance[input] < 0 && excistance[input] > order_value) {
    		char variable1;
    		std::cout << "Only " << excistance[input] << " left! Do you wish to order the last " << excistance[input] << " products (y/n)" << std::endl;
    		std::cin >> variable1;
    		if (variable1 == 'y') {
    			std::cout << "\nYour ordler will be processed...\n\nYour order was successfull!" << std::endl;
    			
    		}
    		else if (variable1 == 'n') {
    			std::cout << "The ordering process is canceled...";
    		}
    		else {
    			std::cout << "The input was wrong. Please restart the programm!";
    		}
    	}
    	else if (excistance[input] >= order_value) {
    		std::cout << "Your order was successful!";
    	}
    }
    


  • Habe manche Operatoren vertauscht. Habe diese aber gefixxt, und es geht immer noch nicht... Hier mein neuer Code:

    #include <iostream>
    int main() {
    	int excistance[3] = { 4, 19, 0 };
    	int input;
    	int order_value;
    	std::cout << "Enter the article number: ";
    	std::cin >> input;
    	std::cout << "Enter the value you wish to order: ";
    	std::cin >> order_value;
    	if (excistance[input] == 0) {
    		std::cout << "Caution: No products available! Please contact the Support" << std::endl;
    
    	}
    	else if (excistance[input] > 0 && excistance[input] < order_value) {
    		char variable1;
    		std::cout << "Only " << excistance[input] << " left! Do you wish to order the last " << excistance[input] << " products (y/n)" << std::endl;
    		std::cin >> variable1;
    		if (variable1 == 'y') {
    			std::cout << "\nYour ordler will be processed...\n\nYour order was successfull!" << std::endl;
    			
    		}
    		else if (variable1 == 'n') {
    			std::cout << "The ordering process is canceled...";
    		}
    		else {
    			std::cout << "The input was wrong. Please restart the programm!";
    		}
    	}
    	else if (excistance[input] >= order_value) {
    		std::cout << "Your order was successful!";
    	}
    }
    


  • kann es sein das du deine Sourcen in OneDrive hast und damit auch die exe in OneDrive gespeichert wird, aber die exe aus OneDrive nicht ausführbar ist? Nur so als Idee von deinem Pfad her begründet

    Gruß



  • @redexception
    Öffne ein Konsolenfenster, navigiere zu dem Ordner, in dem die erstellte exe - Datei liegt, und führe sie aus dem Konsolenfenster heraus aus.


Anmelden zum Antworten