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 必须在两个文件中同时写明。

  • 相关阅读:
    sqlserver2005"此数据库没有有效所有者,因此无法安装数据库关系图支持对象"的解决方法
    重复表的复制操作
    重复表中连级下拉框采用数据源时,子级下拉框列表数据无法持久的问题
    SQL server2005连接与进程
    重复表操作
    XPath语法
    Request.ServerVariables 参数大全
    50个Sql语句
    Inside C++ new/delete and new[]/delete[]
    颜色空间
  • 原文地址:https://www.cnblogs.com/openix/p/2735724.html
Copyright © 2011-2022 走看看