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)
这实际上是如何工作的?我遇到**指针问题
说如果我想输入
[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) 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)