Re: C and C++
- From: "Wade Ward" <invalid@xxxxxxxxxxxx>
- Date: Fri, 29 Jun 2007 03:29:42 -0400
"Logan Shaw" <lshaw-usenet@xxxxxxxxxxxxx> wrote in message
news:46830f9f$0$8003$4c368faf@xxxxxxxxxxxxxxxxx
Bill Cunningham wrote:This is a legal invocation of main?
I have been having trouble getting used to C. A very simple
language. Could this be because I was very familiar with C++ before
trying to learn C? The fstream header is so simple. using fopen, fread
and fwrite for example seems complicated.
There is an art to getting things done easily in C code. Writing concise
C code that isn't also cryptic and buggy is an even more difficult art.
But it can be done, to some extent.
A lot of it involves learning and developing idioms to accomplish tasks
in a certain standard way with a minimum of extra added steps.
For example, to see if argv contains the switches "-fast" or "-slow",
and to accumulate all the arguments that aren't switches into another
list, you might do something like this:
int main(int argc, char* argv[])
--
Wade Ward
.
- Follow-Ups:
- Re: C and C++
- From: Richard Heathfield
- Re: C and C++
- References:
- C and C++
- From: Bill Cunningham
- Re: C and C++
- From: Logan Shaw
- C and C++
- Prev by Date: Re: The software I wish I had
- Next by Date: Re: C and C++
- Previous by thread: Re: C and C++
- Next by thread: Re: C and C++
- Index(es):