Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What does 'if' function mean?

Status
Not open for further replies.

Help

Advanced Member level 2
Advanced Member level 2
Joined
Feb 15, 2005
Messages
617
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
7,065
Hi,

if(CHARACTER == '\n')

what is this mean??

Thanks...
 

Re: 'if' function

Try explaning your problem in more details
if(CHARACTER == '\n')

CHARACTER is a char type which checks for '\n'

the ascii value of '\n' is 10

if it is a match condition is true and code after the if is executed else not

Regards
Deven
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Re: 'if' function

This looks like a matlab branching function. The double equal signs are a comparison of the variable named character and the \n. This will return a logic true or false which the if statement will act on.
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Re: 'if' function

Hi,

I already understand, the ASCII code show the 10=A is LF (Line Feed), that mean the Line Feed is next line izit??

Can you tell me the ASCII function from 0-31 and how to use it, haa...ha... the 32 i know.. is space. The other (33-127) i understand...

Thank you..
 

Re: 'if' function

CHARACTER is a variable of char type. That means, that somwhere in the program code there should be a line like

char CHARACTER;

'\n' is a C standard char type constant, which means "New Line", an integer value is equal to 10, or 0x0A

Similarly the '\r' is a char type constant that means "Carriage Return" with value 13, or 0x0D.

You can find all ASCII codes on: https://www.lookuptables.com/

Varuzhan
 

Re: 'if' function

Hi,

Q1)
Can you give the simple sample program got related the \r (Carriage Return), how to use this command and how it work??

Q2)
Do you know how to use the ASCII, eg. NUL, SOH, STX, ETX, EOT, ENQ, SO, SI, .... and so on? Do you have any webside teach you how to use the code?

Thany you..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top