2286 views|12 replies

3222

Posts

0

Resources
The OP
 

(c = getchar()) Under what circumstances will it be equal to EOF? [Copy link]

 

(c = getchar()) Under what circumstances will it be equal to EOF?

C语言EOF.png (260.72 KB, downloads: 0)

C语言EOF.png
This post is from 51mcu

Latest reply

Yes. The result in the brackets here is the result in the if () brackets you saw in the previous post.   Details Published on 2020-7-20 15:13
 

6040

Posts

204

Resources
2
 

The console input shortcut keys are ctrl+z or ctrl+d. I can’t remember which one it is. They are different for Unix and Windows systems.

This post is from 51mcu

Comments

Console input shortcut keys ctrl+z or ctrl+d----------------Do you mean that pressing trl+z or ctrl+d in the console interface will exit the above loop statement?  Details Published on 2020-7-17 14:23
Console input shortcut keys ctrl+z or ctrl+d----------------Do you mean that pressing trl+z or ctrl+d in the console interface will exit the above loop statement?  Details Published on 2020-7-17 12:05
 
 
 

3222

Posts

0

Resources
3
 
lcofjp posted on 2020-7-17 11:54 The console input shortcut key is ctrl+z or ctrl+d. I can't remember which one it is. Unix and Windows systems are different.

Console input shortcut keys ctrl+z or ctrl+d----------------Do you mean that pressing trl+z or ctrl+d in the console interface will exit the above loop statement?

This post is from 51mcu
 
 
 

3222

Posts

0

Resources
4
 
lcofjp posted on 2020-7-17 11:54 The console input shortcut key is ctrl+z or ctrl+d. I can't remember which one it is. Unix and Windows systems are different.

Since there are bitwise AND and logical AND, are there also bitwise OR and logical OR, bitwise XOR and logical XOR?

This post is from 51mcu

Comments

There is no logical XOR operator, but all others are available. Look at the table yourself.  Details Published on 2020-7-18 19:34
There is no logical XOR operator, but all others are available. Look at the table yourself.  Details Published on 2020-7-17 17:01
 
 
 

6040

Posts

204

Resources
5
 
QWE4562009 posted on 2020-7-17 14:23 Since there are bitwise and and logical and, are there also bitwise or and logical or, bitwise xor and logical xor? &n ...

There is no logical XOR operator, but all others are available. Look at the table yourself.

This post is from 51mcu
 
 
 

6062

Posts

4

Resources
6
 
This post was last edited by damiaa on 2020-7-17 17:17

&& Logical AND, which can be understood as AND.

|| Logical or, which can be understood as either, that is, the condition can be either

! Logical NOT (unary expression)

Not having this ^^ haha.

This post is from 51mcu
 
 
 

7422

Posts

2

Resources
7
 

I have a very creative mind. I also thought about this question at that time.

This post is from 51mcu
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

4005

Posts

0

Resources
8
 

#defineEOF(-1)

This post is from 51mcu
 
 
 

4005

Posts

0

Resources
9
 
This post was last edited by huo_hu on 2020-7-18 19:42
QWE4562009 posted on 2020-7-17 14:23 Since there are bitwise and and logical and, are there also bitwise or and logical or, bitwise exclusive or and logical exclusive or? &n ...

Bitwise AND & Logical AND &&

Bit inversion~Logical inversion!

Bitwise XOR^Logical XOR is ==

This post is from 51mcu

Comments

Where is this return value 1 reflected?  Details Published on 2020-7-20 14:20
 
 
 

3222

Posts

0

Resources
10
 
huo_hu posted on 2020-7-18 19:34 QWE4562009 posted on 2020-7-17 14:23 Since there are bitwise and and logical and, are there also bitwise or and logical or &n ...

Where is this return value 1 reflected?

QQ图片20200720140539.png (86.53 KB, downloads: 0)

QQ图片20200720140539.png
This post is from 51mcu

Comments

a = (b == c); You can see the value of a.  Details Published on 2020-7-20 14:27
 
 
 

7422

Posts

2

Resources
11
 
QWE4562009 posted on 2020-7-20 14:20 Where is this return value 1 reflected

a = (b == c); You can see the value of a.

This post is from 51mcu

Comments

What does the bracket mean to determine whether b is equal to c? If b is equal to C, then a is 1, otherwise a=0?  Details Published on 2020-7-20 14:45
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

3222

Posts

0

Resources
12
 
freebsder posted on 2020-7-20 14:27 a = (b == c); You can see the value of a.

What does the bracket mean to determine whether b is equal to c? If b is equal to C, then a is 1, otherwise a=0?

This post is from 51mcu

Comments

Yes. The result in the brackets here is the result in the if () brackets you saw in the previous post.  Details Published on 2020-7-20 15:13
 
 
 

7422

Posts

2

Resources
13
 
QWE4562009 posted on 2020-7-20 14:45 What does the bracket mean to determine whether b is equal to c? If b is equal to C, then a is 1, otherwise a=0?

Yes. The result in the brackets here is the result in the if () brackets you saw in the previous post.

This post is from 51mcu
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list