Unix Programming - Re: how to macro define these "ESC" charset like "\n" and compare

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2006 > Re: how to macro define these "ESC" charset like "\n" and compare





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: how to macro define these "ESC" charset like "\n" and compare
Lew Pitcher

2006-06-20, 1:24 pm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


key9 wrote:
> Hi all
>
> I want to use
>
> #define KEY_RETU "\n"
> #define KEY_BKS "\b"


No, you don't. You've already discovered why.

> and use
>
> int ch_;
>
> switch(ch_){
> case KEY_RETU :

[snip]
> so how to define it?



Try

#define KEY_RETU '\n'
...
int ch;
switch(ch)
{
case KEY_RETU:
...

HTH

- --
Lew Pitcher

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - WinPT 0.11.12

iD8DBQFEmDjZagVFX4UWr64RAjIsAKDAEVQoLrUf
rf18gZ6T9DTHBVllKgCgnDTY
Rp9LYXGGDURpAOvmKLAFmXk=
=85fO
-----END PGP SIGNATURE-----

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com