错误:使用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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543665.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C#中毫米与像素的换算方法

C#中以像素作为尺寸单位&#xff0c;像素是一种相对的尺寸概念&#xff0c;与毫米的转换与当前显示器的分辨率有关。在不同分辨率下转换的系数不同。 借助GDI可以完成毫米至像素的转换。 public static double MillimetersToPixelsWidth(double length) //length是毫米&#xf…

Python | 使用__del __()和__init __()实现析构函数和构造函数的示例

To implement a constructor, we use __init()__ and to implement a destructor, we use __del()__ in python. 为了实现构造函数&#xff0c;我们使用__init()__ &#xff1b;为了实现析构函数&#xff0c;我们使用python中的__del()__ 。 Program: 程序&#xff1a; class…

drawer的用法_MMDrawerController抽屉侧边栏的简单使用

1.MMDrawerController是一个简单实用的侧边栏第三方类库。2.在appdelegate页中初始化你需要的左右侧边栏&#xff0c;leftViewController &#xff0c;mainViewController。3.在appdelegate中导入头文件#import "MMDrawerController.h"4.初始化抽屉控制器&#xff1a…

【Android】11.3 屏幕旋转和场景变换过程中GridView的呈现

分类&#xff1a;C#、Android、VS2015&#xff1b; 创建日期&#xff1a;2016-02-21 一、简介 实际上&#xff0c;对于布局文件中的View来说&#xff0c;大多数情况下&#xff0c;Android都会自动保存这些状态&#xff0c;并不需要我们都去处理它。这一节仍以GridView为例&…

foss测试_社区概念-与FOSS社区合作时应遵循的准则

foss测试A steady arrangement of strategies and rules is expected to administer FOSS inside an association. These strategies and rules must be deliberately created to protect that all issues that may influence the interests of the association are tended to.…

74ls161中rco是什么_74ls161引脚图与管脚功能表资料

输入输出CRCPLDEPETD3D2D1D0Q3Q2Q1Q00ФФФФФФФФ00001↑0ФФdcbadcba1↑10ФФФФФQ3Q2Q1Q01↑1Ф0ФФФФQ3Q2Q1Q01↑111ФФФФ状态码加1<74LS161功能表>从74LS161功能表功能表中可以知道&#xff0c;当清零端CR“0”&#xff0c;计数器输出Q3、Q2、Q1、Q0立…

html---textarea初始化时就有个table空格以及tab键操作无效

1 初始化时就有一个tab空格这是由于<textarea></textarea>之间的内容不为空的原因&#xff0c;包含空格和换行&#xff0c;否则浏览器会觉得空格或者换行都是文本域的内容。因此书写时需将<textarea></textarea>紧靠在一起。2 tab键对textarea操作无效…

如何使用JavaScript访问对象的键中有空格的对象?

Sometimes your JavaScript object may contain a key having spaces between them. As a key can also be a string and a string may contain spaces, it is very much possible that you encounter this problem. Consider the following object, 有时&#xff0c;您JavaScr…

python信号量怎么用_Python3.X 线程中信号量的使用方法示例

# -*- coding:utf-8 -*-""" Created by FizLin on 2017/07/23/-下午10:59mail: https://github.com/Fiz1994信号量maxconnections 5...pool_sema BoundedSemaphore(valuemaxconnections)Once spawned, worker threads call the semaphores acquire and releas…

Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake 水题

A. Far Relative’s Birthday Cake题目连接&#xff1a; http://www.codeforces.com/contest/629/problem/A Description Doors family is going celebrate Famil Doorss birthday party. They love Famil Door so they are planning to make his birthday cake weird! The cak…

fedora操作系统优缺点_不同类型的操作系统的优缺点

fedora操作系统优缺点There are following types of Operating systems: 有以下几种操作系统&#xff1a; Batch Operating System 批处理操作系统 Time-Sharing Operating System 分时操作系统 Distributed Operating System 分布式操作系统 Network Operating System 网络操…

python radians函数_Python3 radians() 函数

Python3 radians() 函数描述radians() 方法将角度转换为弧度。语法以下是 radians() 方法的语法:import mathmath.radians(x)注意&#xff1a;radians()是不能直接访问的&#xff0c;需要导入 math 模块&#xff0c;然后通过 math 静态对象调用该方法。参数x -- 一个数值。返…

android decorView详解

摘要 一、DecorView为整个Window界面的最顶层View。 二、DecorView只有一个子元素为LinearLayout。代表整个Window界面&#xff0c;包含通知栏&#xff0c;标题栏&#xff0c;内容显示栏三块区域。 三、LinearLayout里有两个FrameLayout子元素。 (20)为标题栏显示界面。只有一个…

c语言1+2+3+4+5_C程序来计算系列1+(1 + 2)+(1 + 2 + 3)+(1 + 2 + 3 + 4)+ ... +(1 + 2 + 3 + ... + n)...

c语言12345The series is: 1(12) (123) (1234) ... (123...n), we have to find out the sum up to N terms. 该序列是&#xff1a; 1(1 2)(1 2 3)(1 2 3 4) ... (1 2 3 ... n) &#xff0c;我们有找出N个项之和。 Solution: 解&#xff1a; We know the sum of n…

3dmax批量导入obj_ArcGIS 与 3DMax 结合建模

整体技术思路是将项目区二维的CAD测绘底图&#xff0c;通过整理导入到3DMax中&#xff0c;根据CAD底图为基础&#xff0c;绘制三维数字模型。利用Photoshop 平面图像处理软件&#xff0c;对现场采集的照片进行修整&#xff0c;为三维模型制作表面贴图。最终把贴好材质的三维楼体…

iOS对象属性详解

oc对象的一些属性&#xff1a; retain,strong, copy,weak,assign&#xff0c;readonly, readwrite, unsafe_unretained下面来分别讲讲各自的作用和区别&#xff1a;retain&#xff0c;计数器加1&#xff0c; (增加一个指向内存的指针) 对应release&#xff08;计数器&#xff0…

给定一个由n个数字组成的数组,请检查是否存在重复项

This is a searching problem which can be solved using brute force approach. But here we are going to see use of hash table to solve such searching problems at lower time complexity. 这是一个搜索问题&#xff0c;可以使用蛮力方法解决。 但是在这里&#xff0c;我…

字符串乘一个数_【思维拓展】三位数乘两位数,构造最大积和最小积

前面袁老师给大家讲了一个重要结论&#xff0c;并运用这个结论来解决问题&#xff0c;构造两位数乘两位数最大积和最小积的问题。今天&#xff0c;更进一步&#xff0c;三位数乘两位数中&#xff0c;如何构造最大积和最小的积&#xff1f;【问题引入】用9、8、6、5、4这五个数字…

ios 微信支付

服务器签名版本 官方已经是建议使用服务器签名来接入微信支付&#xff0c;实际上从安全上考虑&#xff0c;确实是每个客户端不应该知道RAS密钥&#xff0c;也不需要每个客户端都写一遍签名的算法。 服务端接入流程文档&#xff1a;https://pay.weixin.qq.com/wiki/doc/api/app.…

Python | 基于参数和返回值的功能分类

There are following types of the functions based on their parameters and return values: 根据函数的参数和返回值&#xff0c;有以下几种类型的函数&#xff1a; Function with no argument and no return value 没有参数也没有返回值的函数 Function with no argument …