我有一個簡單的問題。我怎樣才能做到這一點 打印Hello world,然後轉到'anotherMessage',然後打印該函數中的消息,然後跳過下一個cout「Dont print this」並退出,跳過一些代碼並退出程序
另外,如何退出programm,if我交換的功能,但保持相同的語句
void main()
{
cout << "Hello World";
anotherMessage();
cout << "Dont print this";
}
void anotherMessage()
{
cout << "Print this";
}
您可以在'anotherMessage()'定義的末尾放置'exit(0)'。 –
如果我想繼續打印hello world並打印此內容並跳過不打印此行? – Aryan
你知道if語句嗎? – rustyx