Answers for "c programming compiler"

C
2

c compiler online

You can use
1. https://www.onlinegdb.com/
2.https://www.programiz.com/c-programming/online-compiler/
this as well, works really well for me.You can also save code there.
Posted by: Guest on October-27-2021
19

online c compiler

You can try https://www.onlinegdb.com/ this as well, works really well for me.
You can also save code there.
Posted by: Guest on January-07-2021
-1

online c compiler

#include<stdio.h>
void accept_num(int arr[],int n);
int main(void)
{
    int n,ptu[n];
    printf("Enter limit of element in an array:");
    scanf("%d",&n);
    accept_num(ptu,n);
    
   return 0; 
}
void accept_num(int arr[],int n)
{
    int i;
    printf("\nEnter the element:");
    for (i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    for (i=0;i<n;i++)
    {
        printf("\n arr[%d]=%d &arr[%d]=%u",i,arr[i],i,&arr[i]);
    }
}
Posted by: Guest on May-13-2021
0

mpi online C compiler

#include <stdio.h>
#include <mpi.h>

int main(int argc, char** argv) {
    int process_Rank, size_Of_Cluster, message_Item;

    MPI_Init(&argc, &argv);
    MPI_Comm_size(MPI_COMM_WORLD, &size_Of_Cluster);
    MPI_Comm_rank(MPI_COMM_WORLD, &process_Rank);

    if(process_Rank == 0){
        message_Item = 42;
        MPI_Send(&message_Item, 1, MPI_INT, 1, 1, MPI_COMM_WORLD);
        printf("Message Sent: %d\n", message_Item);
    }

    else if(process_Rank == 1){
        MPI_Recv(&message_Item, 1, MPI_INT, 0, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
        printf("Message Received: %d\n", message_Item);
    }

    MPI_Finalize();
    return 0;
}
Posted by: Guest on October-10-2021
0

how do i make my own c compiler

To make your own c compiler:
	* First start with the lexer/tokenizer, it should turn code to tokens like this:
	int main(){return 2;} => INT, SPACE_SEPARATOR, {IDENTIFIER, "main"}, OPENING_BRACE, RETURN_KEYWORD, {LITERAL, "2"}, CLOSING_BRACE
	to do this make a list of tokens and translate code to tokens (i wrote all c tokens for my own c compiler)
	* Second make a Parser:
	it will turn tokens to an AST tree
    you will use it to compile,
    it ressembles this:
    	main.cpp << not important
        	|
            main_entry: {name: "main", type: "function", return_type: "int"}
        	|
           /
		  {return, type: "keyword"}
		   |
		return value: {literal: "2", type: "int"}
	* And third make an x86 code writer
    it should translate the tree to x86
	the result for our code in x86 is:
	    .globl _main
        _main:
            movl    $2 %eax
            ret
PS: i am not giving code so you can write your c compiler in any language, and also make you actually feel like you wrote it yourself instead of copy pasting
Posted by: Guest on June-04-2021

Code answers related to "C"

Browse Popular Code Answers by Language