This code appears to work fine. That - in spite of ongoing STRANGE 'scanf()' behavior. (to which I seem to have found a 'fix').
I'm struggling with the function declaration:
void...
Type: Posts; User: gandsnut
This code appears to work fine. That - in spite of ongoing STRANGE 'scanf()' behavior. (to which I seem to have found a 'fix').
I'm struggling with the function declaration:
void...
Using an fflush(stdout); in the for() loop does fix the problem. Your observation is appreciated. I found elsewhere on the net that no fflush(); is needed if the printf() includes a newline in the...
john.c:
I got this from an online GCC resource:
Function: unsigned int sleep (unsigned int seconds)
The sleep function waits for seconds seconds or until a signal is delivered, whichever...
(Ubuntu 18.04, gcc version 7.5.0)
I don't understand why individual sleep(); calls produce the desired pause in program processing. When I put sleep(); inside a for() loop, it seems all the...
Well, that's clear enough. I am working on a 'C' tutorial series, and this cropped up unexpectedly. Thx.
Sorry, I have no idea what this means, or how it applies here. Thx.
Hello:
(Ubuntu 18.04 gcc version 7.5.0)
Ok... here I thought; "int main()" returned an int. So I tried "return(256)" and bash ($?) reports '0'. "return(255)" reports '255'. Why does...
Thanks much for the supportive, tactful comment. Aside - what's your take on running code through some variety of 'lint'?
I'm on Ubuntu 16.04 w/ gcc 5.4.0
KFN - it's probably best you better your skills with the guidance of the experts here.
To specify, I'm seeking an advisor. Posting code was meant to introduce my style, content.
A thousand comments to "use the // commenting method" are all opinions. I'll listen to such
opinions,...
Since you gave your time to elaborate, I'll respond in detail.
1) thanks for suggesting "const pointers". I've never used such. I'll have to study that.
2) prototyping main() doesn't cause an...
Certainly - you see no point. With respect, I asked for an advisor, not individual-take critiques. Though... I respect that you and a zillion other 'C' programmers choose other code styles,...
In a distant past, I did 'C' programming under many flavors of UNIX, and MS-DOS (during the Windows 3.x days). Not as a hobby, as a career.
I am preparing 'C' programming "learning examples" with...
I saw this but since it was quick to add a 'valgrind' plug-in to Code::blocks, I didn't research EF further...
Sort of. Your Q: strikes at the heart of the project. Believe me, I'm open for...
You got it.
I couldn't agree more.
When I racked up 7-8 hours debugging and researching, I went looking for alternatives. This is a one-off program for personal use. If Joe Blow finds it...
The coding created so far works fine. I'll test more extensively when the project nears completion.
Understood about your "stick to standard C features" opinion. This was the smallest segment of...
JimBlumBerg: As it happens, "xmalloc()" is simply a suggested wrapper for "malloc()". Sticking with the "fxxxx()" file I/O calls was attempted, resulting in many hours of troubleshooting to no...
Hello: The 'Net has helped me so much, time to try and return the favor.
I had spent many hours debugging a file reading program that was generating segmentation fault aborts. With debugging...
My bad. Good catch. I need new glasses.... :( Thanks.
Hello:
I think my 'C' code is correct, but Code::Blocks warns with:
"warning: cast from pointer to integer of different size"
First, the data setups.