c tag

1304 questions


1 answers
47 views
0
Is ~x + ~y == ~(x + y) always false?

When you say that both x and y are paid by two,Is ~x+y==~(x+y) always false?The numbers between 5000 and 5000 are all falseWouldn't there be a true number somewhere?


1 answers
129 views
0
I'm asking about the definition of enum type

enum {RANDOM, IMMEDIATE, SEARCH} strategy;strategy = IMMEDIATE;You can use it like this on C++, but there's an error on CIt's too hard.What should I do?error: conflicting types for ‘strategy’error: pr...

2 years ago

1 answers
81 views
0
Is it ENOENT = "No Such file or directory"?

Nosuch file or directory is shortened to ENOFILEWhat does ENT stand for?

2 years ago

1 answers
74 views
0
What kind of GCC flag do you use when compiling C?

All I know is -Wall, -std=XXX.I want to know the flag that changes warning or warning to errorI searched it on Google and it's all in English so I can't understandㅠ

2 years ago

1 answers
55 views
0
I keep getting warnings when I print out int64_t of C

When int64_t is printed as %d, I keep getting a warningI tried a bigger %lld and it's the same ㅜㅜ lld is the biggest thing I know, what should I do?#include <stdio.h>#include <stdint.h>int...

2 years ago

1 answers
84 views
0
Please explain why this code is vulnerable to buffer overflow

int func(char* str){ char buffer[100]; unsigned short len = strlen(str); if(len >= 100) { return (-1); } strncpy(buffer,str,strlen(str)); return 0;}It's a school assignment. They want us to write ...

2 years ago

1 answers
111 views
0
How do I safely remove spaces before and after?

Everything I come up with is a clicheIs there a standard for removing space characters before/after?I hope it's a very standard look good, safe code.

2 years ago

1 answers
31 views
0
C Code "[0 … 255] From ="...What's that?

static void *gostruct[] = { [0 ... 255] = &&l_bad, ['\t'] = &&l_loop, [' '] = &&l_loop, ['\r'] = &&l_loop, ['\n'] = &&l_loop, [''] = &&l_qup, [':'] ...

2 years ago

1 answers
67 views
0
Is C assigned a stack for every {}?

void foo() { int c[100]; { int d[200]; } //d[0]=1; //Error return;}It's not a situation like if or for, it's just another {}As I left the block, I couldn't write d.The professor said {} is a block in...

2 years ago

1 answers
145 views
0
Can I turn the array over with a function factor without a pointer?

int a[5][5];int* a[5];int** a;When you get an array as a factor, you have to choose one of those three and unify itIs there any way I can turn it over without using a pointer?

2 years ago
« - 62 - »

© 2024 OneMinuteCode. All rights reserved.