D
D
Deni1112021-12-06 22:30:29
C++ / C#
Deni111, 2021-12-06 22:30:29

Why does it throw a Segmentation fault when declaring a simple variable?

#include <stdio.h>

int main()
{
    int a;
    a = 21312;
    printf(a);
    return 0;
}


61ae647cd3460017921404.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2021-12-06
@Deni111

Because you have not even mastered the conclusion. Must beprintf("%d\n", a);

C
CityCat4, 2021-12-07
@CityCat4

Because it's nonsense.
printf()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question