虽然包括<signal.h>
我得到一个错误,说这struct sigaction
是一个不完整的类型.
我不知道该怎么做.
请帮忙
#include <signal.h>
struct sigaction act;
int main(int argc, char** argv)
{
int depth;
/* validate arguments number*/
if(argc < 2)
{
printf("fatal error: please use arguments <MaxChild> <MaxDepth>\n");
exit(1);
}
/* register the realtime signal handler for sigchld*/
/*173*/
memset(&act,0,sizeof(act));
act.sa_handler = sigproc;
sigaction(SIGCHLD, /* signal number whose action will be changed */
&act, /* new action to do when SIGCHLD arrives*/
NULL); /* old action - not stored */
srand(time(NULL));
depth …
Run Code Online (Sandbox Code Playgroud) 在visual c ++中接受下面的代码,g ++将生成错误:"类Derived没有任何字段名Base",它遵循标准?
template <class T>
class Base
{
public:
Base(){};
};
template <class T>
class Derived:public Base<T>
{
public:
Derived():Base(){}
};
Run Code Online (Sandbox Code Playgroud)
顺便说一句:都接受
Derived():Base<T>(){}
Run Code Online (Sandbox Code Playgroud)
所以,我会跟着gcc
例:
int foo(void)
{
static volatile int data;
data = 0xaaa;
/* something to assure cache flushing */
if (data == 0xaaa)
return 1;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
问题是什么可以保证冲洗.谢谢.