M
M
Maxim2018-10-17 00:47:46
C++ / C#
Maxim, 2018-10-17 00:47:46

Passing by reference in C99?

#include "stdio.h"

int ap(int * a){
    return *a;
}

int al(int &a){
    return 1;
}

int main(){
    int a = 5;

    printf("%i", a);

    return 0;
}

Why only 1 option works?
  1. g++ .\demo.c
  2. gcc .\demo.c
  3. gcc .\demo.c -std=c99

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2018-10-17
@Got_Oxidus

Links in C?? This is something new. Am I missing an update?
Because the first option compiles the code as C++.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question