分类: C/C++
2009-07-27 16:30:11
#include
#include
using namespace std;
int main(int argc,char **argv[])
{
#ifdef __cplusplus
cout << "this is cpp\n";
#endif
cout << "this file is complied : " << __TIME__ << " " << __DATE__;
string s1("11");
ifstream infile(s1.c_str(), ios::in);
if(!infile) exit(1);
string text;
while(getline(infile, text,'\n')){
cout << "read:"<< text <<"\n";
}
return 0;
}
makefile:
all : clean tt
.PHONY : all
clean :
-rm *.o tt core
tt : test.o
CC -o t test.o
test.o : test.c
CC -c test.c