Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Zero division
Qt 6.11 is out! See what's new in the release blog

Zero division

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moravas
    wrote on last edited by
    #1

    Hi,

    I met a quite ugly problem. I wrote a short C++ program:
    @
    #include "iostream"
    int main() {
    double d = 10 / 0;
    return 0;
    }
    @

    This is NOT Qt project, this is a very simple main.cpp file.
    As you can see I would like divide with zero. I get compile time warning and run time exception too.

    If I copy this code to my Qt base project, I will not get warning and exception but I don't understand, why??? Can anybody help me?

    Regards,
    Norbert

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mehrdadsilver
      wrote on last edited by
      #2

      I was tested this code in linux and windows. I received Warning in both of them. in windows , I get run time error but in linux don't get error. On x86 linux, this exception is presented to the program as a signal and no run time error.

      Mehrdad Abdolghafari, Be silver

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        Hi,

        What compiler did you use for your non-Qt program?

        What compiler did you use for your Qt program?

        Did you use a Debug build?

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved