我正在学习C++,但我只开发控制台应用程序,因为图形C++开发是如此困难,那么我想知道,如果我可以开发控制台像Palm OS应用程序,我是什么想要的是,编译此代码为Palm OS为例:开发控制台就像应用程序的Palm OS
// ClientFille.cpp
// Cria um arquivo sequencial.
#include <iostream>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::ios;
#include <fstream> // Fluxo de arquivos
using std::ofstream; // Gera a saída do fluxo do arquivo
#include <cstdlib>
using std::exit; // Sai do protótipo de funcão
int main()
{
// Construtor ofstream abre arquivo
ofstream outClientFile("Clients.dat", ios::out);
// Fecha o programa se não conseguir criar o arquivo
if (!outClientFile) // Operador ! sobrecarregado
{
cerr << "File could not be opened" << endl;
exit(1);
} // Fim do if
cout << "Enter the account, name, and balance." << endl
<< "Enter end-of-file to end the input.\n? ";
int account;
char name[ 30 ];
double balance;
// Lê conta, nome e saldo a partir de cin, então coloca no arquivo
while (cin >> account >> name >> balance)
{
outClientFile << account << ' ' << name << ' ' << balance << endl;
cout << "? ";
} // Fim do while
return 0; // Destruitor ofstream fecha o arquivo
} // Fim de main
谢谢!
一分钟开发自己的操作系统,下一个他自己的编译器。现在在一个Palm上编写C++应用程序!我不得不承认,与纳丹在一起时刻都没有沉闷。 – 2009-08-02 21:30:33