| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Auto string-length determination |
PW> void main() {
PE> Which besides being ILLEGAL returns RANDOM errorlevels to DOS.
PW> Well now -- I don't know if the Feds will be jumping down my neck just cuz
PW> I declare main() as void :) BTW don't you like Russian Roulette...?
PW> I write my programs properly (sort of). If I NEED to return a value from
PW> my programs, I usually use exit() or something...
PE> exit(x) is as valid as return(x), but I use the latter to avoid
PE> getting a warning message from various compilers. BFN. Paul.
PW> I usually only return values
No, you ALWAYS return values. They're just random unless you put an
explicit "return (0)" etc from main. (I'm only talking about
main BTW).
PW> if some sort of critical error occurs. BTW
PW> why would exit() cause a warning?
Because the compiler is expecting to see a return from main (a function
which returns int), and all it sees is a a function call, no return. BFN.
Paul.
@EOT:
---
* Origin: X (3:711/934.9)SEEN-BY: 633/267 270 @PATH: 711/934 808 50/99 635/728 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™.