gcc编译出现:error: invalid operands to binary & (have ‘char *’ and ‘int *’)
/*************************************************************************
> File Name: ptr_variable.c
> Author: Mr.Yang
> Purpose:演示指向变量的指针
> Created Time: 2017年06月03日 星期六 08时47分33秒
************************************************************************/ #include <stdio.h>
#include <stdlib.h> int main(void)
{
int a = ;
printf("a的地址为:%d\n",&a); int *p;
*p = ;
printf("指针p的地址为:%d\n"&p); return ;
}
错误描述如下:
ptr_variable.c: In function ‘main’:
ptr_variable.c::: error: invalid operands to binary & (have ‘char *’ and ‘int *’)
printf("指针p的地址为:%d\n"&p);
说明:错误出现在main函数,第18行,错误类型二进制操作数无效,printf函数中char *和int *并列了,错误的代码为printf("指针p的地址为:%d\n"&p);仔细查看,可知道中间少了一个逗号。
gcc编译出现:error: invalid operands to binary & (have ‘char *’ and ‘int *’)的更多相关文章
- 报错:invalid operands to binary - (have ‘int’ and ‘char *’)
//这个题是输入大写的一串字符,然后按A对应1...这个规律求乘积 char a[],b[]; scanf("%s",a); scanf("%s",b); in ...
- MAC 调用GCC 提示xcrun: error: invalid active developer path
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: ...
- ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法
sass文件编译时候使用ruby环境,无论是界面化的koala工具还是命令行模式的都无法通过,真是令人烦恼. 容易出现中文注释时候无法编译通过,或者出现乱码,找了几天的解决方法终于解决了. 这个问题的 ...
- Package CJK Error: Invalid character code. 问题解决方法--xelatex和pdflatex编译的转换
Package CJK Error: Invalid character code. 问题解决方法--xelatex和pdflatex编译的转换 解决方法:添加格式说明信息 将下面语句: \docum ...
- fedora/centos下gcc编译出现gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory
fedora/centos下gcc编译出现gcc: error trying to exec 'cc1plus': execvp: No such file or directory解决办法 翻译自: ...
- 编译错误error: invalid&nbsp…
昨天遇到一个莫名其妙的编译错误,以前没有见过,而且代码流程看起来也没有太多的奇异之处.后来忍无可忍,百度了下,发现别人也有遇到这个错误的,他的解决方法是:少了"}". 嘿嘿,我开始 ...
- sass文件编译(.scss->.css),使用ruby环境,在windows10,koala工具,Error: Invalid GBK character "\xE5"
1 注意事项: 问题描述: 请确保 Encoding.default_external = Encoding.find('utf-8') 是uft-8 编码! sass文件编译时候使用ruby环境,在 ...
- 问题:编译eshoponcontainers失败,提示error:invalid reference format
环境: visual studio 2017 v15.4.2,docker ce Version 17.06.0-ce-win19 (12801) 参考问题页: https://github.com/ ...
- gcc编译错误表
conversion from %s to %s not supported by iconv”iconv 不支持从 %s 到 %s 的转换” iconv_open”iconv_open” no ic ...
随机推荐
- C++ mfc 简易文本编辑器 遇到的一些问题
[题目40]简易文本编辑器. 设计一个简易的文本编辑器. 设计要求: (1) 具有图形菜单界面: (2) 查找,替换(等长,不等长),插入(插串,文本块的插入).文本块移动(行块,列块移动),删除; ...
- poj 2376 Cleaning Shifts 最小区间覆盖
Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 40751 Accepted: 9871 ...
- 配置thinkphp对mysql线上线下切换不同环境的配置 - (mysql-thinkphp) (1)
1.先打印出配置项的信息,在Index控制器下面的index->index里面设置 namespace app\index\controller; class Index { public fu ...
- Python基础week1
本节内容 Python介绍 发展史 Python 2 or 3? 安装 Hello World程序 变量 用户输入 模块初识 .pyc是个什么鬼? 数据类型初识 数据运算 表达式if ...else语 ...
- 二十六、JavaScript之查找子字符串substring和slice和substr
一.代码如下 二.效果如下 <!DOCTYPE html> <html> <meta http-equiv="Content-Type" conten ...
- 使用WebClient下载文件到本地目录
利用WebClient实现下载文件 调用 string url = "https://timgsa.baidu.com/timg?image&quality=80&size= ...
- java基础源码 (3)--Annotation(注解)
借鉴博客地址:https://www.cnblogs.com/skywang12345/p/3344137.html /** * The common interface extended by al ...
- 前端第三篇---前端基础之JavaScript
前端第三篇---前端基础之JavaScript 一.JavaScript概述 二.JavaScript的基础 三.词法分析 四.JavaScript的内置对象和方法 五.BOM对象 六.DOM对象 七 ...
- 寒假第一发(CF水题两个)
地址http://codeforces.com/contest/799 A. Carrot Cakes In some game by Playrix it takes t minutes for a ...
- Go语言开发环境的搭建(Goland和VSCode)
教程首发于:微信公众号<Go编程时光>,欢迎你一起来学习 1. 下载安装 Go语言 下载地址:https://golang.google.cn/dl/ 下载完成后,直接双击 msi 文件进 ...