错误:使用printf()打印Hello world时未声明'Hello'/ Text
While printing "Hello world", if this error 'Hello' undeclared occurred that means Hello is supplied to the compiler as a variable not as a text/string.
在打印“ Hello world”时 ,如果发生未声明的错误“ Hello” ,则意味着Hello是作为变量而不是text / string提供给编译器的 。
This is possible only, when starting double quote is missing inside the printf(). To fix this error, you should take care of double quotes; place the constant string/text in double quotes.
仅当在printf()中缺少双引号时这才可能。 要解决此错误,您应该注意双引号。 将常量字符串/文本放在双引号中。
Example:
例:
#include <stdio.h>
int main(void) {//closing double quote is missing
printf(Hello world");
return 0;
}
Output
输出量
prog.c: In function ‘main’:
prog.c:4:9: error: ‘Hello’ undeclared (first use in this function)printf(Hello world");^~~~~
prog.c:4:9: note: each undeclared identifier is reported only once
for each function it appears in
prog.c:4:15: error: expected ‘)’ before ‘world’printf(Hello world");^~~~~
prog.c:4:20: warning: missing terminating " characterprintf(Hello world");^
prog.c:4:20: error: missing terminating " characterprintf(Hello world");^~~
prog.c:6:1: error: expected ‘;’ before ‘}’ token}^
What happens, if we use single quote instead of double code in starting of the text/string?
如果我们在文本/字符串的开头使用单引号而不是双代码会怎样?
Missing terminating ' character error will be thrown.
缺少终止字符错误将被抛出。
How to fix?
怎么修?
To fix this error, close the text/string/Hello within the double quotes.
要解决此错误,请关闭双引号内的text / string / Hello。
Correct code:
正确的代码:
#include <stdio.h>
int main(void) {//closing double quote is missing
printf("Hello world");
return 0;
}
Output
输出量
Hello world
翻译自: https://www.includehelp.com/c-programs/hello-or-text-undeclared-while-printing-hello-world-using-printf-error-in-c.aspx
错误:使用printf()打印Hello world时未声明'Hello'/ Text相关推荐
- c语言如何打印矩形图形的程序 五行七列,C语言程序计 第二讲.printf打印图形.转义字符.格式声明符.doc...
白匿潮抛辣胖嫡隅费唤激百努弱兢终秃疵褪沉硝脊逆躁剪帕份谍契氟栖概更羊劣租砾纳丸酬革峭泌惊淡橡巩席索庇豫疥屿愿点红星湾叉淤儒途童煤堵挽淘影碾轻霜秩隐憋昆躇笔员肌插驾宠炙彻抛负洞匝谓羚颠荧红魏赦严宛骏按氯 ...
- c++输入错误重新输入_C程序-根据时长和时薪计算工资1.3(解决输入非数字选项退出的bug)...
程序内容: 提供五种工资菜单,用户自行选择,读取用户输入的工作时长,计算工资和净收入,及其缴纳的税金.(C Primer Plus 第7章 第8题) 程序更新:解决输入非数字选项后退出程序的bug. ...
- 【printf】sprintf字符串转数值、数值转字符,拼接字符,函数详细解释 Printf 打印数值...
1.数值转成字符: sprintf个函数,如: sprintf(s, "%d", 123); //产生"123" 2.字符串转成数值: while(*BandR ...
- QT 使用printf() 打印结果
printf()打印 尝试在QT中使用printf打印结果,但是每次都是要关闭程序后,才能在控制台显示,虽然结果都显示了出来,但是不是我们要的时机出现. 原来是因为打印结果在缓冲区未被释放,所以无法显 ...
- STM32高级开发(12)-在GCC中使用printf打印串口数据
在大家使用keil或是iar开发stm32等arm芯片的时候,想来最不陌生的就是使用print通过串口输出一些数据,用来调试或是其他作用.但是要明确的是由于keil iar gcc 他们使用的标准C语 ...
- 编译器错误~System.Data.Objects.DataClasses.EntityObject在未被引用的程序集中定义
编译器错误消息: 类型"System.Data.Objects.DataClasses.EntityObject"在未被引用的程序集中定义. 必须添加对程序集 "Syst ...
- Optional orElseThrow 错误: 未报告的异常错误X; 必须对其进行捕获或声明以便抛出...
情况说明 以下代码: Optional.ofNullable(u).map(u->{.... }).orElseThrow(()->{throw new CommonException(& ...
- 错误:未报告的异常错误,必须对其进行捕获或声明以便抛出
错误:未报告的异常错误,必须对其进行捕获或声明以便抛出 出现错误:是因为没有对异常进行捕获或声明 首先说一下Java 中throws的作用: 假如函数部分有不合法的异常,例如分母为0: import ...
- 出现“未报告的异常错误,必须对其进行捕获或声明以便抛出”的解决
错误:未报告的异常错误,必须对其进行捕获或声明以便抛出 出现错误:是因为没有对异常进行捕获或声明 首先说一下Java 中throws的作用: 假如函数部分有不合法的异常,例如分母为0: import ...
最新文章
- android web 打印,Android设备WebView打印Console Log
- mysql 创建表_MySQL创建表(十一)
- Spring Boot的事务管理注解@EnableTransactionManagement的使用
- 微软已暂时停用你的帐户_Apple ID 被停用如何解决?
- 解读SSL ***技术(二)
- iOS UIDatePicker设置为中文的方法
- (数组) leetcode 189. Rotate Array
- 如何设置电脑自动锁屏_Apple ID密码忘了怎么重置?丨如何让面容和指纹解锁立马失效?...
- null和空的区别 oracle,Oracle中NULL与空字符串''的区别的总结
- 问卷调查设计应注意避免的六大禁忌
- python通达信,显示K线图
- 高级职称计算机考试要求考a级,全国职称计算机考试有哪些级别
- 数独解法Java实现
- 周轶璐教授:服务好医生,如何更全面地了解数据、利用数据?
- pg中多值列_PostgreSQL中列的statistics属性
- 文本文件后缀修改为 .html
- php反转图片颜色,PHP 图片处理类(水印、透明度、缩放、相框、锐化、旋转、翻转、剪切、反色)...
- c语言求幸运数字程序,算法题挑选幸运数字,该如何处理
- 正则表达式的介绍及应用
- ScyllaDB安装