🌐
Stack Overflow
stackoverflow.com β€Ί questions β€Ί 64836613 β€Ί online-compileronline-gdbworks-correctly-while-g-and-gcc-on-windows-10-cmd-d
c - online compiler(online gdb)works correctly while g++ and gcc on windows 10 cmd doesn't work when comparing strings - Stack Overflow
When I compare 2 strings in the website "online gdb", if the comparison is equal it gives 10, if it's not it doesn't give 10(It's already weird that it gives 10 instead of 0, but it works so I didn't care). But since I tried to compile my code with g++ or gcc(I tried with -g too for both)it gives -1 or 1, or only 1, but never 0.
🌐
OnlineGDB
onlinegdb.com β€Ί BkaSj74KB
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.
Discussions

Question Regarding Compiling C on OnlineGDB
What’s the minimum code that results in this error? More on reddit.com
🌐 r/cprogramming
11
6
March 31, 2022
Are there any online compilers that allow projects and can surpass OnlineGDB's 100kb limit?
Visual Studio Code isn't a compiler, it's a piece of crap editor. If you want to drive G++ with it, you must also install that. Frankly, save yourself a lot of grief and install VisualStudio Community Edition and be done with it. More on reddit.com
🌐 r/Cplusplus
8
8
November 22, 2022
Why is onlineGDB not giving the same result as another compiler?
Thank you for your contribution to the C++ community! As you're asking a question or seeking homework help, we would like to remind you of Rule 3 - Good Faith Help Requests & Homework. When posting a question or homework help request, you must explain your good faith efforts to resolve the problem or complete the assignment on your own. Low-effort questions will be removed. Members of this subreddit are happy to help give you a nudge in the right direction. However, we will not do your homework for you, make apps for you, etc. Homework help posts must be flaired with Homework. ~ CPlusPlus Moderation Team I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/Cplusplus
8
1
May 4, 2024
🌐
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.
🌐
Programiz
programiz.com β€Ί cpp-programming β€Ί online-compiler
Online C++ Compiler - Programiz
Write and run your C++ code using our online compiler. Enjoy additional features like code sharing, dark mode, and support for multiple programming languages.
🌐
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.
🌐
JDoodle
jdoodle.com β€Ί start-coding
Online Compiler and Editor/IDE for Java, C, C++, PHP, Python, Ruby, Perl - Code and Run Online
JDoodle is an Online Compiler, Editor, IDE for Java, C, C++, PHP, Perl, Python, Ruby and many more. You can run your programs on the fly online, and you can save and share them with others. Quick and Easy way to compile and run programs online.
Find elsewhere
🌐
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
🌐
Reddit
reddit.com β€Ί r/cprogramming β€Ί question regarding compiling c on onlinegdb
r/cprogramming on Reddit: Question Regarding Compiling C on OnlineGDB
March 31, 2022 -

I'm so, so sorry if this post is not appropriate here, but I am a very new programmer and I'm really struggling to find an answer here. If this is the wrong place for this post, please let me know and I will delete it ASAP.

I'm currently enrolled in an intro programming class learning C. We use OnlineGDB as our compiler, and we are currently working on a project that is teaching us to read data from a file and store that data in various arrays.

I'm understanding all the concepts and my code executes perfectly - UNTIL I declare a new variable. Any kind of variable, in any part of the main function. If I declare any new variable, my code stops working at all. There are no errors - but there is also no output.

I've talked with multiple TAs from my class, and they either can't figure out what's going on, or they won't tell me. I've googled everything I can think to Google, and can't find any answers. I'm desperate at this point.

Again, if this post is inappropriate, I apologize and will remove it immediately. But if not, I would so greatly appreciate any help you guys can give me.

Thanks in advance.

Edit: Here is my code. All of the array declarations that are commented out cause the issue described above. If I try to add even one of them, I get no output.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

const int SUPNUM = 30;
const int NAMLEN = 29;

int findSmYear(int pubYear[], int recYear, int count);

int main()
{
    char lastNm[SUPNUM][NAMLEN];
    char firstNm[SUPNUM][NAMLEN];
    char superNm[SUPNUM][NAMLEN];
    //char pubNm[SUPNUM][NAMLEN];
    //char pantheonNm[SUPNUM][NAMLEN];
    //char eyeColor[SUPNUM][NAMLEN];
    //char species[SUPNUM][NAMLEN];
    //char hairColor[SUPNUM][NAMLEN];
    char gender[30];
    int pubYear[30];
    //int issueNum[30];
    //int movieYear[30];
    //double height[30];
    //double weight[30];
    int count;
    char *word[NAMLEN];
    char fline[128];
    FILE * shIn;
    char fileNm[] = "n.txt";
    
    shIn = fopen(fileNm, "r");
    
    if (shIn == NULL)
        printf("ERROR: File not found.");
    else
    {
        count = 0;
        
        while (!feof(shIn))
        {
            fgets(fline, 128, shIn);
            
            strcpy(lastNm[count], strtok(fline, ","));
            
            strcpy(firstNm[count], strtok(NULL, ";"));
            
            gender[count] = *strtok(NULL, " ");
            
            strcpy(*word, strtok(NULL, " "));
            strcpy(superNm[count], "");
            while (atof(*word) == 0)
            {
                strcat(superNm[count], *word);
                strcat(superNm[count], " ");
                strcpy(*word, strtok(NULL, " "));
            }
            
            pubYear[count] = atoi(*word);

            count++;
            
        } // End of while loop
        
        for (int k = 0; k < count; k++)
        {
            printf("%d. %s %s, AKA %s - %c - First published in %d\n",
                k + 1, firstNm[k], lastNm[k], superNm[k], gender[k], pubYear[k]);
        }
        
        
        // Find the most recent publication year
        int recYear = 0;
        
        for (int k = 0; k < count; k++)
        {
            if (pubYear[k] > recYear)
                recYear = pubYear[k];
        }
        
        printf("\nThe most recent publication year is %d.\n\n", recYear);
        
        
        // Find the earliest publication year using a function
        int earlYear = findSmYear(pubYear, recYear, count);
        
        printf("The earliest publication year is %d.\n\n", earlYear);
        
        
        // Find the first alphabetical superhero name
        int alpha = 0;
        
        for (int k = 0; k < count; k++)
            if (strcmp(superNm[k], superNm[alpha]) < 0)
                alpha = k;
        
        printf("The first superhero name alphabetically is %s.\n\n", superNm[alpha]);
        
    } // End of else loop

    return 0;
}

int findSmYear(int seeYear[], int bigYear, int count)
{
    int smYear = bigYear;
    
    for(int k = 0; k < count; k++)
    {
        if(seeYear[k] < smYear)
            smYear = seeYear[k];
    }
    
    return smYear;
}

Perhaps I should add that this issue occurred once before when trying to initialize the int earlYear variable (only when initializing it, not declaring it). A TA fixed it by changing the name of the file that the program is reading from (name changed from shDataSpr22A.txt to n.txt), but declined to explain why this fixed the issue.

🌐
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 web tool is an online compiler and debugging tool supporting multiple programming languages like C, C++, Java and more.
🌐
CodeChef
codechef.com β€Ί c-online-compiler
Online C Compiler
Welcome to our AI-powered online C compiler, the perfect platform to run and test your C code efficiently. Our tool makes coding easy for developers of any skill level, whether you're a beginner or experienced.
🌐
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
question.onlinegdb.com β€Ί 16297 β€Ί how-to-read-from-a-file-txt-in-c-online-gdb
How to read from a file(txt) in c++ online GDB? - OnlineGDB Q&A
June 24, 2024 - Hi, so I am confused as to how to connect and use files(txt) that I have saved to my folder. I ... its output to a second file. How do I do that?