escape sequence

N

N U

How to program your own escape sequence [programmer defined] using
basic functions available in C?
 
A

Andreas Kahari

How to program your own escape sequence [programmer defined] using
basic functions available in C?

How do you mean? Do you want to change the meaning of '\n' or
'\t'? You can't do that in C.
 
J

Jeff

N U said:
How to program your own escape sequence [programmer defined] using
basic functions available in C?

You didn't describe your question clearly. If you want to write your own
"print line" function to replace printf, then you should use string function
to locate the "\" and insert the things you wanted.
 
T

Tom Zych

Jeff said:
You didn't describe your question clearly. If you want to write your own
"print line" function to replace printf, then you should use string function
to locate the "\" and insert the things you wanted.

Problem with that is, the compiler will see them first and convert
them. So you'd have to use \\ everywhere. Fuggly...
 
J

Jeff

Tom Zych said:
Problem with that is, the compiler will see them first and convert
them. So you'd have to use \\ everywhere. Fuggly...

Yes, even the OP use another character as the escape character, the "\" will
still confuse the compiler.
 
T

Tom Zych

Jeff said:
Yes, even the OP use another character as the escape character, the "\" will
still confuse the compiler.

Well, if they use something other than '\' as the escape character,
they won't need to use '\' at all, except in the usual way.
 
N

N U

Jeff said:
N U said:
How to program your own escape sequence [programmer defined] using
basic functions available in C?

You didn't describe your question clearly. If you want to write your own
"print line" function to replace printf, then you should use string function
to locate the "\" and insert the things you wanted.

What i meant by progammer defined escape sequence was something, like
ctrl+c/d that terminates an application. in case the programmer want
to define something like this and then use that escape seq. to
partially terminate the application i.e go from one part to another
through the use of escape sequence [without using the menu's].
 
L

LibraryUser

N said:
Jeff said:
How to program your own escape sequence [programmer defined]
using basic functions available in C?

You didn't describe your question clearly. If you want to write
your own "print line" function to replace printf, then you
should use string function to locate the "\" and insert the
things you wanted.

What i meant by progammer defined escape sequence was something,
like ctrl+c/d that terminates an application. in case the
programmer want to define something like this and then use that
escape seq. to partially terminate the application i.e go from
one part to another through the use of escape sequence [without
using the menu's].

No escape sequence needed. Look up the use of EOF.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top