zoukankan      html  css  js  c++  java
  • 测试

    有一天,你运用了extern、volatile,结构显示conflicting type qualifiers


    myhead.h

          1 #ifndef MYHEAD                                                                                              
          2 #define MYHEAD
          3
          4 extern int a;
          5 extern void show();
          6
          7 #endif

    test.c

          1 #include <stdio.h>                                                                                          
          2 #include "myhead.h"
          3 int a=3;
          4 int main(int argc, char *argv[])
          5 {
          6
          7     show();
          8     printf("%d\n",3);
          9     return 0;
         10 }

    或者:

    myhead.h

          1 #ifndef MYHEAD                                                                                              
          2 #define MYHEAD
          3
          4 externvolatile  int a;
          5 extern void show();
          6
          7 #endif

    test.c

         1 #include <stdio.h>                                                                                          
          2 #include "myhead.h"
          3 volatile int a=3;
          4 int main(int argc, char *argv[])
          5 {
          6
          7     show();
          8     printf("%d\n",3);
          9     return 0;
         10 }


    volatile 必须在两个文件中同时写明。

  • 相关阅读:
    python之enumerate
    Python中的集合set
    SGU 分类
    太空飞行计划 最大权闭合图
    1.飞行员配对 二分图匹配(输出方案)/最大流斩
    poj1149最大流经典构图神题
    hdu1569 方格取数 求最大点权独立集
    最大独立集 最小点覆盖 最小边覆盖 最小路径覆盖 最大团
    hdu3491最小割转最大流+拆点
    hdu3987,最小割时求最少割边数
  • 原文地址:https://www.cnblogs.com/openix/p/2735724.html
Copyright © 2011-2022 走看看