level 1
浅草游魂Cm
楼主
程序中cout语句为何不执行?求助。
#include<iostream>
#include "SDL/SDL.h"
#include <conio.h>
#include <stdio.h>
using namespace std;
int main(int argc, char *argv[]) {
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
std::cout<<"let's begin"<<std::endl;
system("pause");
try {
if (SDL_Init(SDL_INIT_EVERYTHING) == -1)
throw "Could not initialize SDL!";
}
catch(const char *s) {//catch函数定义?函数定义不是规定不能放在主函数中吗?
std::cerr << s << std::endl;
return -1;
}
int a=5;
cout << "a="<<a<<"<>"<< endl;
sleep(5);
//clrscr();
std::cout << "SDL initialized.\n";
SDL_Quit();
return 0;
}
2015年06月02日 09点06分
1
#include<iostream>
#include "SDL/SDL.h"
#include <conio.h>
#include <stdio.h>
using namespace std;
int main(int argc, char *argv[]) {
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
std::cout<<"let's begin"<<std::endl;
system("pause");
try {
if (SDL_Init(SDL_INIT_EVERYTHING) == -1)
throw "Could not initialize SDL!";
}
catch(const char *s) {//catch函数定义?函数定义不是规定不能放在主函数中吗?
std::cerr << s << std::endl;
return -1;
}
int a=5;
cout << "a="<<a<<"<>"<< endl;
sleep(5);
//clrscr();
std::cout << "SDL initialized.\n";
SDL_Quit();
return 0;
}
