Results 1 to 6 of 6

Thread: Im not getting the expected result

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Im not getting the expected result

    Quote Originally Posted by sauerplayer View Post
    so If I modify this code will it work?
    You are not serioulsy asking that instead of trying it, right?

    Cheers,
    _

  2. #2
    Join Date
    Oct 2016
    Posts
    10
    Platforms
    Windows

    Default Re: Im not getting the expected result

    Quote Originally Posted by anda_skoa View Post
    You are not serioulsy asking that instead of trying it, right?

    Cheers,
    _
    I found the and fixed the problem, now it works correctly, the problem was that I did not initialize PrecioFinal before using it, but it had to be done inside the constructor...

    Factura::Factura(){

    precioFinal = 0;

    establecerDatos( numeroDePieza = "", descripcionDePieza = "", cantidadDeArticulos = 0, precioDeArticulo = 0 );
    }

    still I do not undesrtand why, if I try to initialize precioFinal to 0 inside Factura.h it fails to do so...

    the error message I get for this is : C:\Users\eyel\Desktop\CBlocks\Clase9\Factura.h|30|warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11|

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Im not getting the expected result

    Quote Originally Posted by sauerplayer View Post
    still I do not undesrtand why, if I try to initialize precioFinal to 0 inside Factura.h it fails to do so...

    the error message I get for this is : C:\Users\eyel\Desktop\CBlocks\Clase9\Factura.h|30|warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11|
    As the compiler hints that is available from the C++11 standard onwards.
    If you are building for an older standard then you need to use assignment in code or the constructor's initialization list.

    Cheers,
    _

Similar Threads

  1. SQL result problem
    By unix7777 in forum Newbie
    Replies: 7
    Last Post: 13th August 2012, 23:31
  2. How i can plot result in my GUI ?
    By 21did21 in forum Qwt
    Replies: 58
    Last Post: 18th June 2011, 00:41
  3. Replies: 10
    Last Post: 22nd May 2011, 15:58
  4. QRegExp - get only last result
    By kabanek in forum Newbie
    Replies: 2
    Last Post: 3rd November 2010, 22:17
  5. How to display result
    By sksingh73 in forum Newbie
    Replies: 1
    Last Post: 7th June 2010, 08:39

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
  •  
Qt is a trademark of The Qt Company.