编译器的问题? vb6.0 VS visual studio 2012

程序代码:#include

void main()

{

int i=3,j=5;

int *p,*q;

p=&i;

q=&j;

float a=5.8,b=7.9;

float *c,*d;

c=&a;

d=&b;

char m='I',n='L';

char *x,*y;

x=&m;

y=&n;

printf("i=%d, j=%d\n",*p,*q);

printf("a=%g, b=%g\n",*c,*d);

printf("m=%c, n=%c\n",*x,*y);

}

以上很简单的一段代码,主要是试试用指针,在vb6.0里面可以实现,但是在ms visual studio 2012里面,就不行

编译不通过

1>------ Build started: Project: Have a try, Configuration: Debug Win32 ------

1>  Have a try.c

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(9): error C2143: syntax error : missing ';' before 'type'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(10): error C2143: syntax error : missing ';' before 'type'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(11): error C2065: 'c' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(11): error C2065: 'a' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(11): warning C4047: '=' : 'int' differs in levels of indirection from 'int *'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(12): error C2065: 'd' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(12): error C2065: 'b' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(12): warning C4047: '=' : 'int' differs in levels of indirection from 'int *'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(14): error C2143: syntax error : missing ';' before 'type'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(15): error C2143: syntax error : missing ';' before 'type'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(16): error C2065: 'x' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(16): error C2065: 'm' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(16): warning C4047: '=' : 'int' differs in levels of indirection from 'int *'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(17): error C2065: 'y' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(17): error C2065: 'n' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(17): warning C4047: '=' : 'int' differs in levels of indirection from 'int *'

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(20): error C2065: 'c' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(20): error C2100: illegal indirection

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(20): error C2065: 'd' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(21): error C2065: 'x' : undeclared identifier

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(21): error C2100: illegal indirection

1>c:\users\dell\documents\visual studio 2012\projects\have a try\have a try\have a try.c(21): error C2065: 'y' : undeclared identifier

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

请问大家,这是为什么呀?

如果将程序代码改成

程序代码:#include

void main()

{

int i=3,j=5;

int *p,*q;

float a=5.8,b=7.9;

float *c,*d;

char m='I',n='L';

char *x,*y;

p=&i;

q=&j;

c=&a;

d=&b;

x=&m;

y=&n;

printf("i=%d, j=%d\n",*p,*q);

printf("a=%g, b=%g\n",*c,*d);

printf("m=%c, n=%c\n",*x,*y);

}

就 OK了,这又是为什么呀?

谢谢

vb6.0可以编译c语言嘛,编译器的问题? vb6.0 VS visual studio 2012相关推荐

  1. 在Visual Studio 2012中使用VMSDK开发领域特定语言(一)

    前言 本专题主要介绍在Visual Studio 2012中使用Visualization & Modeling SDK进行领域特定语言(DSL)的开发,包括两个部分的内容.在第一部分中,将对 ...

  2. 在Visual Studio 2012中使用VMSDK开发领域特定语言(二)

    本文为<在Visual Studio 2012中使用VMSDK开发领域特定语言>专题文章的第二部分,在这部分内容中,将以实际应用为例,介绍开发DSL的主要步骤,包括设计.定制.调试.发布以 ...

  3. 【转】visual studio 2012进行C语言开发[图文]

    原文网址:http://blog.csdn.net/chengyafei0104/article/details/9826025 现在大家计算机大概都脱离XP了,so,之前蛮多可以用的编译器,可能放在 ...

  4. Windows 7(Win7)下Visual Studio 2012(VS2012)编译jrtplib与MinGW编译jrtplib

    一.下载jrtplib.jthread.CMake.Visual Studio 2012和Qt5.5.1 jrtplib:http://research.edm.uhasselt.be/jori/jr ...

  5. c语言在线编译(c语言在线编译器手机版)

    c语言代码(在线) 这个程序我见过!地址如下. 程序是没有任何问题的.do..while只是为了提高程序的判断验错能力.给你解释一下: void insert() int i=n,j,g; //这里n ...

  6. c语言中数组结尾的0的作用,C语言里面一个数组最后的\0表示什么意思?

    qq_莫非 #include #include #include #include #include #include #include #include #include #define PORT  ...

  7. Latex002 | 详细教程:LaTeX 编译器哪个好?——如何在 Visual Studio Code 中全流程编写 LaTeX(上篇)

    一.LaTeX 一般用的编译器 一开始配置 LaTeX 环境的时候,我没有想太多,和大多数人一样直接去网上搜了编译器的选择.在互联网所提供给我们的海量资源中,以下这些是我认为值得一试的一些选择: Wi ...

  8. C语言学习之路(工具篇)—— Visual Studio的使用

    说明:该篇博客是博主一字一码编写的,实属不易,请尊重原创,谢谢大家! 第一个C语言程序 Visual Studio新建项目 源文件-添加-新建项 通过Visual Studio运行 通过gcc编译后运 ...

  9. vs2017c语言程序添加图标,笔试编程必备技巧——Visual Studio 2017添加自定义代码片段...

    本文目录 代码模板 代码片段功能 step by step 添加自定义代码片段 传送门--常用IDE实现代码片段的方法 代码模板 如何有限的笔试时间中提高编程效率?除了提高自身代码能力之外,事先的准备 ...

最新文章

  1. 比ewsa更快的跑包工具_重庆单肩包订购,编织布袋定做厂家
  2. 北京冬奥又曝黑科技:连气象主播都是AI虚拟人
  3. VMware中CentOS7网卡无法启动故障
  4. makefile编译_C++ Lesson 5:编译Makefile
  5. 如何基于netty实现mq 编程思路
  6. [BZOJ1503][NOI2004]郁闷的出纳员 无旋Treap
  7. 你真的需要 @DirtiesContext?
  8. leecode练习--942、增减字符串匹配
  9. php smarty 调试模式,Smarty3调试
  10. oracle系统的物料编码,物料编码汇总专题[大家一起努力将其补充完善!以方便大家查阅!] - □-Oracle ER......
  11. Windows 2000 下载
  12. 如何建立复杂城市排水系统模型?基于SWMM与城市内涝一维二维耦合模型的复杂排水系统建模/城市排涝/海绵城市技术
  13. Proteus 封装 全加器 FA
  14. win8.1修改用户名
  15. 编码器解码器网络:神经翻译模型详解
  16. 让QQ群昵称色变的神奇代码
  17. Linux ora-12514多实例,ORA-12514: 错误的解决
  18. OptaPlanner
  19. 使用runOnUiThread更新UI
  20. 浅析N沟道增强型MOS管的工作原理

热门文章

  1. 【IDEA 教程系列第 13 篇】idea 快速搜索类、文件
  2. 简易费诺算法的C语言实现
  3. 必备软件——下载工具
  4. 极高水平的电吉他音源 Orange Tree Samples Evolution Stratosphere Kontakt
  5. 浅谈2019苏宁易购校招面试
  6. python自守数_自守数-随心随性无为而为-51CTO博客
  7. 解密2019如何打造爆款短视频,打造爆款短视频的必要条件!
  8. CISSP 考试知识要点总结
  9. yolov5使用教程
  10. 画论87 陈撰《书画涉笔》