| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | [C] how is it done? |
Wed 2004-02-04 17:02, John Dumas (1:261/38.1) wrote to
andrew.clarke!3.633.267.0{at}filegate.:
JD> int (*cat)(char *);
JD> int sound( char *noise )
JD> {
JD> printf( "%s\n",noise ) ;
JD> return 1;
JD> }
JD> cat = &sound;
JD> cat ( "meow" );
JD> Is there a way to:
JD> cat "meow";
JD> without the ( ) ?
Not in C. BASIC and REXX are two languages that come to mind that allow this syntax.
JD> may use a define?
JD> #define (cat x) (cat (x))
JD> does not work
JD> I heard a basic was written in C.
A basic what?
If you mean the language BASIC was written in C, then that makes little
sense. It's possible to write a BASIC interpreter (or compiler) in
virtually any computer language you like, however the original BASIC
interpreters were most likely all written in assembler (machine code
mnemonics).
JD> I was going to try to make a more script like program.
Over time you may appreciate the benefits of C syntax over the syntax of
languages you already know.
-- mail{at}ozzmosis.com
--- timEd/FreeBSD 1.11.b1
* Origin: Blizzard of Ozz, Melbourne, Victoria, Australia (3:633/267)SEEN-BY: 633/267 270 @PATH: 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.