Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how much bit compiler is used for c and c++ by onlinegdb tool?

+3 votes
asked May 9 by Vidula Meshram (150 points)

1 Answer

0 votes
answered May 11 by Peter Minarik (58,190 points)
edited May 12 by Peter Minarik

Update: 64-bit compiler is used

For details, see the comments below.

Original answer

What do you mean by "bit compiler"?

Could you please make your question more accurate? Add some details, explanations, and maybe some examples to help others better understand what you're after.

Thank you.

commented May 11 by Vidula Meshram (150 points)
how many bits means whether 32 bit compiler/ 64 bit compiler. As it would help to know the size of different datatype
commented May 12 by Peter Minarik (58,190 points)
edited May 12 by Peter Minarik
#include <stdio.h>

int main()
{
    printf("word size: %lu bytes", sizeof(int*));
    return 0;
}

This will tell you how many bytes form a word (a pointer in our case). Whether 4 bytes (32 bit) or 8 bytes (64 bit).

Why a pointer? Because that's a memory address and when we talk about architecture, it limits the maximum memory address we can use. So the size of the pointer reveals the architecture.

After running the above piece of code it seems like the compiler defaults to 64-bit compilation.

If you apply the flag (gear icon, "Extra compilation flags") "m64" (no quotes) you force 64-bit compilation.
If you apply the flag (gear icon, "Extra compilation flags") "m32" (no quotes) you force 32-bit compilation, but that fails to compile, so 32-bit compilation doesn't seem to be available for C projects.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...