小编Jon*_*ono的帖子

C双指针

struct counter{
    long long counter;
}

struct instruction{
    struct counter *counter
    int repetitions;
    void (*work_fn)(long long *);
};

int ncounter; //number of counters
struct counter *counter; //counter array

int nthreads; //number of threads
int *ninstructions; //number of instructions

struct instruction **instructions; 
Run Code Online (Sandbox Code Playgroud)

这实际上是如何工作的?我遇到**指针问题

c

5
推荐指数
1
解决办法
2万
查看次数

scanf错误处理C

说如果我想输入

[Name] [Name]
Run Code Online (Sandbox Code Playgroud)

我将如何检测

[Name] [Name] [Name] 
Run Code Online (Sandbox Code Playgroud)

并返回错误?

这是我到目前为止的一切

char in[20];
char out[20];
scanf(" %s %s", out, in);
Run Code Online (Sandbox Code Playgroud)

c error-handling

3
推荐指数
2
解决办法
2万
查看次数

C内存泄漏问题

your program did not free all of the memory it allocated
==17711== Memcheck, a memory error detector
==17711== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==17711== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==17711== Command: ./counter
==17711==
==17711== Conditional jump or move depends on uninitialised value(s)
==17711==    at 0x400B98: main (counter.c:105)
==17711==
==17711== Conditional jump or move depends on uninitialised value(s)
==17711==    at 0x400BDB: main (counter.c:107)
==17711==
==17711== Conditional jump or move depends …
Run Code Online (Sandbox Code Playgroud)

c memory-leaks

0
推荐指数
1
解决办法
366
查看次数

标签 统计

c ×3

error-handling ×1

memory-leaks ×1