Thread: infinite compile time

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    87

    infinite compile time

    hi, i was making a quine using two @@ symbols to represent the string and then testing for them when i cout the string.

    my problem came when i heard that then the text must compile and run, i tried doing this with
    Code:
    system("path, filename");
    but when i would compile it it just ran forever and nothing came up

    i think that the problem is that when i did the system command on the exe the compiler then will compile that, see it again, and repeat,

    i was just wondering if this is my problem or if it is something else

    i use codeblocks and was running it in debug, maybe release would work.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    When you say "compile", do you mean "run"? If your compiler runs without stopping, then chances are that you need a new compiler.
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by bithub View Post
    When you say "compile", do you mean "run"? If your compiler runs without stopping, then chances are that you need a new compiler.
    Or and older one... The only compiler I know of that hangs during compilation, is VS2010's, but only under 32-bit XP.

    A quine isn't supposed to self-compile. It just produces a copy of its source code when executed.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    87
    i use code blocks and i hit f9 which is "build and run", so yes.

    A quine isn't supposed to self-compile. It just produces a copy of its source code when executed.
    this depends on your definition, some say that it has to output its source, then the source had to run, then that will make it run again.......
    but others just settle for outputting the source

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by bobknows View Post
    this depends on your definition, some say that it has to output its source, then the source had to run, then that will make it run again.......
    By that definition, the source will be compiled and run indefinitely (effectively an infinite recursion).

    However, iMalc is correct. The formal computing definition of a quine is a program that outputs its own source.

    What you are alluding to - although you have misinterpreted - is that, in some interpreted languages, a quine can be achieved using a function that, for some specified arguments, returns itself applied to those arguments. That is not possible in C or C++.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  6. #6
    Registered User
    Join Date
    Jan 2011
    Posts
    87
    ok, i see.

    but why would this still not run?
    it just sits there and processes until codeblocks stops working.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NtSetSystemTime() failed
    By medp7060 in forum C++ Programming
    Replies: 11
    Last Post: 04-02-2010, 02:58 AM
  2. Using pointers
    By Big_0_72 in forum C Programming
    Replies: 3
    Last Post: 10-28-2008, 07:51 PM
  3. C# Compile Time Debugging
    By mindtrap in forum C# Programming
    Replies: 4
    Last Post: 09-17-2007, 09:40 AM
  4. Need help with time
    By Gong in forum C++ Programming
    Replies: 7
    Last Post: 01-11-2007, 02:43 PM
  5. Debugging mode selection during compile time
    By YALINI in forum C Programming
    Replies: 1
    Last Post: 09-03-2001, 09:56 AM