--------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00001 Date: 01/22/98 From: FRANK ADAM Time: 07:00pm \/To: NEIL HELLER (Read 0 times) Subj: WARNING MESSAGE - 2 On Jan 17 09:24, 1998, Neil Heller of 1:161/204 wrote: G'day Neil, NH> unsigned char foo = 'z'; NH> foo = foo >> 3; /* warning on this line */ Foo is a uchar, 3 is an int. Regards, Frank. Email: fadam@sensation.net.au. --- Msged 4.20 beta 4 * Origin: The ticking point, Melbourne, Australia. (3:635/728.21@fidonet) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00002 Date: 01/22/98 From: FRANK ADAM Time: 07:25pm \/To: AUKE REITSMA (Read 0 times) Subj: Moderator nominations On Jan 17 16:31, 1998, Auke Reitsma of 2:281/400.20 wrote: G'day Auke, AR> Merging the C_echo and C_plusplus ... current count: Please put me down for NO. Regards, Frank. Email: fadam@sensation.net.au. --- Msged 4.20 beta 4 * Origin: The ticking point, Melbourne, Australia. (3:635/728.21@fidonet) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00003 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: TOM TORFS (Read 0 times) Subj: Re: isdigit() Groovy hepcat Tom Torfs jived with Peter Haywood on 30 Dec 97 11:28:20! isdigit()'s a cool scene. Dig it! PH> if(EOF == sscanf(buf, " %d", &num)) /* try to extract a number PH> from the line */ PH> return 0; /* error */ PH> If number is not encountered, zero is returned, otherwise the value of PH> the number is returned. TT> Shouldn't you check for a return value of 0 from sscanf() also ? See Oops! Yes. I forgot that. OK, I'll fix it now: int foo; if(((foo = sscanf(buf, " %d", &num)) == EOF) || (foo == 0)) return 0; Wolvaen ... I'm gettin' a woodrow! - Beavis --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00004 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: BILL BIRRELL (Read 0 times) Subj: Re: Pointer to a string Groovy hepcat Bill Birrell jived with Trevor Dennett-Thorpe on 21 Dec 97 04:17:00! Pointer to a string's a cool scene. Dig it! BB> Hey Trevor, > test_str[] = "This is a test"; BB> However there is one thing to guard against in the very concept. BB> If the string is a constant, you *may not* clear it. You are permitted BB> to clear only volatiles - that is arrays of char to which values have BB> been assigned. Constants are not necessarily stored in read/write BB> memory. Who said anithing about a constant? He is using an initialised array of (non-const) char. The formal parameter could be as you stated, a char *, or it could be a char array (which "decays" to a pointer). Wolvaen ... "Bother" said Pooh as his fur turned gray and he began losing his memo --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00005 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: ANDY HAIGH (Read 0 times) Subj: Re: Groovy hepcat Andy Haigh jived with on 23 Dec 97 14:41:30! 's a cool scene. Dig it! AH> about this ]] command ( <--but not this) can I just enter it from the AH> keyboard or do I have to use the alt job. I'm not sure to what you are refering. What is ]]? AH> When I use my borland 4.5 compiler for windows I can just press the AH> key next to the shift and the char appears but not in dos. The keys next to shift on my keyboard (there are two shift keys) are Z and ? (or /). AH> its a bit crazy. If I want this OR command I have to use alt to get AH> it. You mean the logical or bitwise OR operator? The logical one is ||, and the bitwise one is |. They are not commands; they're operators. You don't need to use the alt key. The key which makes this character is the backslash (\) with shift key pressed. Is that what you wanted? Wolvaen ... No wanna work. Wanna bang on keyboard. --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00006 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: ROBERT WILKINSON (Read 0 times) Subj: Re: Pointer to a string Groovy hepcat Robert Wilkinson jived with Trevor Dennett-Thorpe on 24 Dec 97 02:20:10! Re: Pointer to a string's a cool scene. Dig it! T> test_str[] = "This is a test"; T> RW> clr_string(test_str). However, it's not a good idea to try and clear RW> a constant value... It's not a constant value. It's an initialised array type. The initialiser does not make it a const array. If he had said char *test_str = "This is a test."; then it would be a pointer to const array. But the datum as given is not const. Wolvaen ... Does Spock use pointed Q-Tips? --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00007 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: JACK D. (Read 0 times) Subj: Re: HELP!!! Groovy hepcat Jack D. jived with All on 26 Dec 97 05:18:36! HELP!!!'s a cool scene. Dig it! JD> Can somebody write a program that ask the user to input two number to Yes, I'm sure somebody can. JD> divid and if the answer is a full one it will output the answer BUT if Homework? How much money have you got to spend? A good grade ain't cheap, y'know. JD> the answer contain a remainder it will output "The answer is %d and JD> the remainder is %d". I hope you all understand. Until you give me alot of money to do this assignment for you, you're going to have to give it a try yourself. If you need help just ask. People here are more than willing to help those who help themselves. We are even willing to do your homework. Everyone has their price. Show us what you've done so far, give us the lowdown on what you're having trouble with, and we'll endeavour to help you solve your problem. Make international money order in Australian currency or cheque drawn on Australian bank out to... Wolvaen ... "Consult an investment broker," was Tom's stock answer. --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00008 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: KEN WAUGH (Read 0 times) Subj: Re: can this be fixed Groovy hepcat Ken Waugh jived with All on 30 Dec 97 10:11:00! can this be fixed's a cool scene. Dig it! KW> int HandleMyedIDCMP( void ) KW> { KW> struct IntuiMessage *m; KW> struct MenuItem *n; KW> int (*func)(); KW> BOOL running = TRUE; KW> etc... KW> } KW> func = (void *)(GTMENUITEM_USERDATA( n )); ^^^^^^^^ This is probably better cast to (int (*)(void)). KW> running = func(); I assume these two lines are meant to be within the block above. KW> Even though 'func' is defined above, when the above attempts to A pointer called func is declared above. The function type it is supposed to point to is not prototyped. All the compiler knows about this function pointed to by func is that it returns an int. Hence the warning you mention below. KW> compile I get the warning 'no prototype declared for function pointer' KW> on the line 'running = func'. KW> The program works just fine, but to make certain that I clean up all KW> warnings/errors, I'd like to find a way to get rid of that warning. Properly prototype func. For example: int (*func)(void); /* func is pointer to function taking no args & returning int */ Wolvaen ... "X is an integer," Tom declared. --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00009 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: NEIL HELLER (Read 0 times) Subj: Re: WHAT DOES THIS WARNING ME Groovy hepcat Neil Heller jived with Bob Stout on 31 Dec 97 14:36:00! WHAT DOES THIS WARNING ME's a cool scene. Dig it! BS> To correct this, you need to explicitly declare the constant as BS> unsigned by changing the line to... BS> temp_uword = 60000U; NH> If I were to set temp_uword equal to another variable of type NH> "unsigned int", would any modifiers be necessary? Does this apply No. Assignment of the same type is straight forward. NH> only for constants? Yes. These modifiers only work on constants. To assign a value from a variable or function call of diferent type, use a cast. For example: long foo = 60000L; unsigned bar; bar = (unsigned)foo; Wolvaen ... LA bumper sticker: Cover me, I'm changing lanes. --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 239 C LANGUAGE Ref: F1W00010 Date: 01/24/98 From: JOHN GARDENIERS Time: 04:50pm \/To: TIKA CARR (Read 0 times) Subj: Moderator Nominations Hi Tika, -=> 20 Jan 98 18:23, Tika Carr wrote to John Gardeniers <=- TC> All you'd need is E-Mail, really. Juno provides it for free* and also I think the international phone call to connect to Juno might be a bit much. ;-) TC> Well, we seem to have some good candidtates for moderatorship. We certainly do. Hardly need another. TC> Hope you can "qualify" next time around. :) Who knows? ttyl, >>> Fuse >>> --- GoldED/386 3.00.Alpha4+ * Origin: The Cubby House, I C it but I don't believe it (3:634/391)