PDA

View Full Version : Developing Console Like Apps For Palm OS


nathanpc
07-31-2009, 11:03 AM
Hello,
I'm learning C++, but i only develop console apps, because graphical C++ development is so much difficult, then i want to know if i can develop console like apps for Palm OS, what i want is this, compile this code for Palm OS for example:
// 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

Thanks,
Nathan Paulino Campos

MetaView
07-31-2009, 04:22 PM
Have a look into "Standard IO" in the API Reference.

philpalm
08-08-2009, 12:16 PM
Have a look into "Standard IO" in the API Reference.
google API reference?