Problems with "atof" from <cstring> library
- From: Wätzold Plaum <waetzold_plaum yahoo de>
- To: gtkmm-list gnome org
- Subject: Problems with "atof" from <cstring> library
- Date: Tue, 11 Apr 2006 19:50:06 +0200 (CEST)
Hello,
I've got a strange problem with gtkmm. In the following there are two little programms which are mainly the same, but just changed the position of "Gtk::Main kit(argc, argv);" The results are different. The first version does it right. The second not. Why?
Best Regards,
Wätzold
=========== BEGIN ============
#include <cstring>
#include <gtkmm/main.h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char cha[] = "0.5";
double mass_;
cout << "\nCha: " << cha << endl;
mass_ = atof( cha );
cout << "mass: " << mass_ << endl;
Gtk::Main kit(argc, argv);
//MainWindow mainwindow;
//Gtk::Main::run(mainwindow); //Shows the window and returns when it is closed.
return 0;
}
======== END 1===========
#include <cstring>
#include <gtkmm/main.h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
char cha[] = "0.5";
double mass_;
cout << "\nCha: " << cha << endl;
mass_ = atof( cha );
cout << "mass: " << mass_ << endl;
//MainWindow mainwindow;
//Gtk::Main::run(mainwindow); //Shows the window and returns when it is closed.
return 0;
}
==========END 2===========
Telefonieren Sie ohne weitere Kosten mit Ihren Freunden von PC zu PC!
Jetzt
Yahoo! Messenger installieren!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]