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
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.
Online C
OnlineGDB is online IDE with c compiler. Quick and easy way to compile c program online. It supports gcc compiler for c.
Online C++
OnlineGDB is online IDE with C++ compiler. Quick and easy way to compiler c++ program online. It supports g++ compiler for c++.
Java
OnlineGDB is online IDE with java compiler. Quick and easy way to run java program online.
Python
OnlineGDB is online IDE with python compiler. Quick and easy way to compile python program online. It supports python3.
🌐
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
It is the world's first online IDE with an integrated gdb debugger that allows debugging. It does not demand the download and installation of any software on your pc. A useful web tool for coders who enjoy coding online.
🌐
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 - It allows you to code, compile, run, and debug online from anywhere, with any device. Online GDB has a user-friendly interface, and it supports several standard libraries and features such as breakpoints, variable watches, and automatic code ...
🌐
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.
🌐
BibSonomy
bibsonomy.org › url › 8d06f8668c3dfd984211b57b46ba60f1
GDB online Debugger - Code, Compile, Run, Debug online C, C++ | BibSonomy
compiler · 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).
Find elsewhere
🌐
Compiler Explorer
godbolt.org
Compiler Explorer
Compiler Explorer is an interactive online compiler which shows the assembly output of compiled C++, Rust, Go (and many more) code.
🌐
OneCompiler
onecompiler.com › java › 3y2qtv2z7
- Java - OneCompiler
Pricing · Learn · Deploy · import java.util.*; public class Main { public static void main(String[] args) { Date now = new Date(); System.out.println("Hello World!"); System.out.println("now: " + now); } } · created 3 years ago
🌐
FastBit
fastbitlab.com › home › microcontroller embedded c programming lecture 15| online gdb web tool
Online GDB web tool - Your Virtual Compiler and Debugger
June 7, 2024 - Online GDB is an online compiler and debugging tool that allows you to write, compile, and debug code in various programming languages, including C, C++, Java, Python, PHP, VB, C# and more.
🌐
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.
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;
}
🌐
Code with C
codewithc.com › code with c › blog › real-time debugging with online gdb compiler
Real-time Debugging With Online GDB Compiler - Code With C
January 12, 2024 - Accessing the platform: First things first, head over to the Online GDB Compiler platform. Whether you’re on your laptop, tablet, or even a smartphone, this tool is just a few clicks away. Simply create an account or dive right in as a guest – the choice is yours! Uploading and running code for real-time debugging: Once you’re in, it’s time to upload your code! With a few quick keystrokes and clicks, you can upload your code and run it through the Online GDB Compiler, all while keeping a sharp eye out for any bugs or errors that rear their sneaky little heads!
🌐
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.
🌐
CodeChef
codechef.com › ide
Online Compiler & IDE for Python, C++, C, Java, Rust - CodeChef
Compile & run your code with the CodeChef online IDE. Our online compiler supports multiple programming languages like Python, C++, C, JavaScript, Rust, Go, Kotlin, and many more.
🌐
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 ...