views:

91

answers:

2

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!

+2  A: 

The command line interface method of I/O isn't really efficient on devices that are designed around touch/tap screens for the majority of their user interaction - so while you could, probably, find some way to do console-type I/O, it wouldn't be an ideal user experience.

Not to mention, most Palm devices (and other PDAs) don't have full 102+ key keyboards - so inputting things like EOF isn't going to be trivial.

Amber
It's applications that are only for me, or library's for Palm OS.
Nathan Campos
And C++ graphical development is so much confusing.
Nathan Campos
Just learn Qt. It is worth it -- cross-platform, and now with decent licensing. It makes even GUI-writing easy.
Dirk Eddelbuettel
But i can do Palm OS apps with it?
Nathan Campos
+1  A: 

The only built-in stdin/stdout interface on Palm OS is the secret "network console". I wrote about this in an old blog entry at http://palmos.combee.net/blog/HiddenIOConsole.html. However, there's no C++ binding for this, so you'd need to make your own stream classes that call into these functions, and the old version of the SDK you need is long forgotten on ACCESS's current website. You can probably find it in an old copy of CodeWarrior for Palm OS.

Ben Combee