Results 1 to 6 of 6

Thread: char to const char* with atof

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default char to const char* with atof

    Hello, I have this problem; it gets a runtime error. Why?
    Qt Code:
    1. vector<double> vec;
    2. string s =" 123213131313131331";
    3. string::iterator it_s = s.begin();
    4. for ( ; it_s != s.end(); ++it_s) {
    5. vec.push_back( (double) atof( (const char *) (*it_s) ) ); //runtime error
    6. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by mickey; 28th February 2008 at 23:49.
    Regards

Similar Threads

  1. QSql*Model + QTreeView : make a tree
    By punkypogo in forum Qt Programming
    Replies: 18
    Last Post: 24th October 2008, 18:14
  2. qt 4.2.2 install in tru64 cxx
    By try to remember in forum Installation and Deployment
    Replies: 0
    Last Post: 30th March 2007, 07:43
  3. unable to save QCStrings properly in a buffer
    By nass in forum Qt Programming
    Replies: 13
    Last Post: 15th November 2006, 20:49
  4. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  5. Delegates and Table
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 18th May 2006, 19:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.