You have a bug in your program. It's hard to guess what it is without seeing the code? In some cases compilers are allowed to do different things with the same code. What are the types of string1 and string2 Answer from jedwardsol on reddit.com
🌐
OnlineGDB
onlinegdb.com › online_c_compiler
Online C Compiler - online editor
OnlineGDB is online IDE with c compiler. Quick and easy way to compile c program online. It supports gcc compiler for c.
🌐
OnlineGDB
onlinegdb.com
GDB online Debugger | Compiler - Code, Compile, Run, Debug online C, C++
Online GDB is online compiler and debugger for C/C++. You can compile, run and debug code with gdb online. Using gcc/g++ as compiler and gdb as debugger. Currently C and C++ languages are supported.
🌐
OnlineGDB
onlinegdb.com › fork › S13OWDh3b
GDB online Debugger | Code, Compile, Run, Debug online C, C++
Online GDB is online ide with compiler and debugger for C/C++. Code, Compiler, Run, Debug Share code nippets.
🌐
Landing.Jobs
landing.jobs › home › an intermediate guide to debugging c code with online gdb c compilers
An intermediate guide to debugging C code with online GDB C compilers - Landing.Jobs
February 16, 2023 - Thread debugging commands include “info threads” to display information about all threads, “thread” to switch to a specific thread, and “break thread” to set a breakpoint only for a specific thread. One major advantage of using an online GDB compiler is that it allows developers to debug their code in a web browser without needing to install GDB on their local machine.
🌐
WebCatalog
webcatalog.io › home › apps › software development › onlinegdb › desktop app
OnlineGDB - Desktop App for Mac, Windows (PC) - WebCatalog
OnlineGDB is an online compiler and debugger for C/C++, offering code editing, execution, and debugging features accessible from any internet-connected device. | Use OnlineGDB in a dedicated, distraction-free window with WebCatalog Desktop for ...
🌐
LogicMojo
logicmojo.com › online-gdb-compiler
Online GDB Compiler By Logicmojo
In general, a debugger is a utility that runs a target program in a controlled environment where you can direct the execution of the program and see its status when it is paused. GDB is a debugger that can be used to analyse C/C++ programs.
Find elsewhere
🌐
OnlineGDB
onlinegdb.com › online_objectivec_compiler
Online Objective-C Compiler - online editor
OnlineGDB is online IDE with objective-c compiler. Quick and easy way to run objective-c program online.
🌐
Stack Overflow
stackoverflow.com › questions › 75880897 › why-does-online-gdb-c-compiler-while-debugging-my-code-suddenly-stops
Why does online GDB c++ compiler while debugging my code suddenly stops? - Stack Overflow
Long run you’ll probably be better off getting tools like this running locally, i.e. on your own computer. If you like GDB, you can get it via WSL on Windows; if you want to try a GUI debugger, Visual Studio Community has an excellent debugger for Windows.
🌐
Programiz
programiz.com › c-programming › online-compiler
Online C Compiler - Programiz
Write and run your C programming code using our online compiler. Enjoy additional features like code sharing, dark mode, and support for multiple languages.
🌐
OnlineGDB
onlinegdb.com › login
Login | GDB online Debugger
IDE Shortcuts: New file : Ctrl-M Run Code : F9 Debug Code : F8 Save Project : Ctrl-S Beautify Code : Ctrl-B Settings Menu : Ctrl-Shift-S Info : Ctrl-I Editor Shortcuts: showSettingsMenu : Ctrl-, goToNextError : Alt-E goToPreviousError : Alt-Shift-E selectall : Ctrl-A gotoline : Ctrl-L fold : Alt-L|Ctrl-F1 unfold : Alt-Shift-L|Ctrl-Shift-F1 toggleFoldWidget : F2 toggleParentFoldWidget : Alt-F2 foldOther : Alt-0 unfoldall : Alt-Shift-0 findnext : Ctrl-K findprevious : Ctrl-Shift-K selectOrFindNext : Alt-K selectOrFindPrevious : Alt-Shift-K find : Ctrl-F overwrite : Insert selecttostart : Ctrl-Sh
🌐
Onlinegdb
learn.onlinegdb.com
Learn Programming Step by Step | Learn Programming step by step
Skip to main content · Choose a programming language you want to learn
🌐
BibSonomy
bibsonomy.org › url › 8d06f8668c3dfd984211b57b46ba60f1
GDB online Debugger - Code, Compile, Run, Debug online C, C++ | BibSonomy
cpp · debugger · gdb · ide · online · webapp · @cnp 9 years ago · (last updated 9 years ago) References · Bookmarks · deleting review · Please log in to take part in the discussion (add own reviews or comments).
🌐
Ideone
ideone.com › fork › zWurpK
Online Compiler and IDE >> C/C++, Java, PHP, Python, Perl and 70+ other compilers and interpreters - Ideone.com
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
Top answer
1 of 2
3

Whoops you have an infinite loop here

//This creates a LCV for the do loop below and sets it equal to 0.

int y = 0;

//This do loop generates the random number.
do
{
    //This generates a random time seed.
    srand(time(0));

    //This generates a random number between 1 and 99.
    ran = rand() % 100;

    //This while controls the do loop.
}while (y != 9);

y is initialized to 0 and you are looping while y!=9. And that is just the first error, there might be more.


Bug #2

int z = 1;
//This makes the program only create a random number the first pass through the loop.
if (z < 2)
{
    //This runs the random number generator function.
    return randomgen();

    //This sets the result of the function as the random number.
    randnum = randomgen();

    //This sets the random number to the current number.
    num = randnum;
}

After fixing infinite loop in randomgen(), You are immediately returning...

2 of 2
1

you have two problems in your code: the first one is that you have infinite loop in randomgen() function the condition in check against y - y != 9 but the value never update

int randomgen() 
{
    //This creates a variable to store the random number.
    int ran;

    //This creates a LCV for the do loop below and sets it equal to 0.
    int y = 0;

    //This do loop generates the random number.
    do
    {
        //This generates a random time seed.
        srand(time(0));

        //This generates a random number between 1 and 99.
        ran = rand() % 100;

        //This while controls the do loop.
    }while (y != 9);

    //This returns the random number for use in the rest of the program.
    return ran;
}

and the second one is even if you pass the loop in the function you exit main right away because the call to the function randomgen() is with return

if (z < 2)
{
    //This runs the random number generator function.
    return randomgen(); <-- **second problome**

    //This sets the result of the function as the random number.
    randnum = randomgen();

    //This sets the random number to the current number.
    num = randnum;
}
🌐
OneCompiler
onecompiler.com › c
C Online Compiler
OneCompiler's C Language editor helps you to write, compile, debug and run C code online. It's powered by GCC compiler