Can anyone recommend a good c programming newsgroup for general questions
and queries. NH
----------
>From: Sam Bayne <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: C programming question...[OT]
>Date: Fri, May 5, 2000, 3:42 am
>
>First of all, thank everyone for helping me out with idiotic basic
>questions.
>
>Gordon Messmer wrote:
>>
>> 1) No, the programmers declared an array of 5 character pointers, not
>> an array of 5 characters. Perl 5 doesn't have pointers, so I understand
>> your confusion :) They're one of the things that non-C programmers
>> bitch about. (If you don't understand pointers, using them is a quick
>> way to a segfault).
>
>Hee hee, perl doesn't have pointers, but it DOES have references. (But
>they have some idiot protections WRT segfault.) The thing that is really
>confusing about C's pointers is not the "they're memory locations"
>thing,
>it's the way they get shuffled back and forth with pointer or array
>notation at the programmer's whim.
>
>> 2) Yes, it's a list of up to five acceptable directories (or so it
>> appears). The maximum size of each of these is not defined, but will be
>> the maximum size of a command line argument. A pointer is an address in
>> memory. Every program is passed two arguments to its main() function,
>> an int and an array of character pointers. The programmers of tftpd are
>> setting each of the pointers in their array to one of the arguments (if
>> there are any arguments). By doing this, they reduce the risk of a
>> buffer overflow by not copying their command line arguments into static
>> buffers. They simply point their variables at the arguments already in
>> memory, rather than duplicate them.
>
>Ok, that was the actual question I was dancing around, so the
>commandline
>parser( I assume one of exec()'s brethren, whatever inetd is using) is
>responsible for bounds checking these then?
>
>
>> 3) Syntactically, the while loop is valid. Style is quite left up to
>> the programmer. If you feel like writing code that looks like Perl, you
>> can :)
>> (I usually code fairly close to the GNU style guides)
>
>I'm going to look those up right quick.
>
>--
>-------------------------------------
>Sam Bayne - System Administrator
>North Seattle Community College
>[EMAIL PROTECTED] (206)527-3762
>=====================================
>
>
>--
>To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
>as the Subject.
>
>
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.