c tag

1304 questions


1 answers
116 views
0
A negative number is derived from rand() + rand().

rand() is always positiveBut why is land() + land() a mixture of positive and negative numbers?srand(time(NULL)) seeded and spun, is it related to that?Is there a case where rand() returns a negative ...

2 years ago

1 answers
91 views
0
Why doesn't printf print out if I don't write the opening letter?

Why doesn't printf automatically print out if you don't write the opening letter?Is that what POSIX decided? How do I automatically print out every time I printf()?

2 years ago

1 answers
139 views
0
Why can't I use alloca()?

As far as I know, alloca() dynamically allocates memory in stack, not heap, and releases memory on its own when it returns from routine Then shouldn't it be recommended because it's safer because it d...


1 answers
151 views
0
Why should global variables be written to a minimum?

The professor told me to use the discharge variable only when it's really inevitableWhy is that?If there are more functions, it's hard to transfer factorsThis is too much trouble

2 years ago

1 answers
122 views
0
Is the code order followed when initializing by writing the initialization list?

In the initialization list, in the order in which you wrote down the code,I wrote the code thinking that initialization was happening.For example, class A{private: OtherClass var1; AnotherClass var2;p...

2 years ago

1 answers
110 views
0
Why is a[1] == 1[a] in the C array?

It's a code that my friend sent me, saying she found a weird function1[a] It compiles well and executes well.What's going on here?int main(){ int* a = (int*)malloc(sizeof(int)*2); a[0] = 1; a[1] = 2; ...


1 answers
179 views
0
I would like to ask you about the Cstatic function

I have a question about the static function, not the c++ static method.I know the static variable, but what is the static function?Also, if you define void myfunc() in another c file and include this ...

2 years ago

1 answers
94 views
0
Where is the bowl type defined in C?

How do you use boolean type in C?bool , true, false all red lines appearedThen do I have to solve everything with 1/0 for C?

2 years ago

1 answers
70 views
0
Why do you define true like #define TRUE (1==1) instead of just 1?

I saw the C chordWhy did they bother writing it like that instead of writing it as 1, 0?Is there anything better?#define TRUE (1==1)#define FALSE (!TRUE)

2 years ago

1 answers
127 views
0
Linux kernel code writes boolean. Is this okay?

As far as I know, there's a bowl only on C++, and you have to define it on CI saw you write boolean in the Linux kernel code.Did I get it wrong? TT?

2 years ago
« - 60 - »

© 2024 OneMinuteCode. All rights reserved.