I think one thing that a lot of folks might overlook in this is that some of us routinely read and post from work. When I'm at home I wanna spend time with my kids and not necessarily helping...
Type: Posts; User: fgw_three
I think one thing that a lot of folks might overlook in this is that some of us routinely read and post from work. When I'm at home I wanna spend time with my kids and not necessarily helping...
Agreed....
I've got a bastardized style that I use: I'll put the brace on the end of the beginning line of an if, for, while, switch (etc) statement. But when I'm doing function blocks, the...
Also, try searching this board.
I seem to recall a post about ISBN parsing posted to the board within the last year.....
To paraphrase Forrest Gump, "safe is as safe does" :)
Seriously, I agree with you. If you're in a situation where your data might be truncated anyway, then it is safer to have it null terminated...
We had this one in here last week as I recall....
Dig around -- I can't remember if much advice was given, but what was given should still be here on the board.
I believe the variants of BSD Unix have a "safe" strcat called strlcat (and there is a companion strlcpy) both of which are guaranteed to truncate AND null terminate instead of overflowing.
You...
Do a google on "secure programming in C" and you'll probably find a bunch of useful information on which C functions can be misused by the programmer and subsequently abused by the bad guys.
Perhaps it is a minor nit, but the type of the fopen return value is not long, but FILE *.
Out of curiosity, why is it that you have to use "touch"?
When I was a kid (and this will definitely show that I'm as old as the hills), GI Joe was about a foot tall. Later on, they made him into a little action figure.
I didn't have many GI Joes.... my...
You're not sending it to another function. In menu, you're just declaring a multi-dimensional array that has absolutely nothing to do with your origina choice array.
You need to actually pass...
Like I said, I was stealing cycles from some real work.;)
I never thought about Salem's point of no potential divisor being greater than the square root, and I never actually fired the program up...
Because you seem about at wits end, here's something that might work....
I think that should work. I'm winging it while I'm doing real work :) here today.... It'll get you closer if it...
Probably, but that doesn't make you a bad person....:)
Actually, you only need to divide the number by a number between 2 on the lower end and number/2 on the upper end. Dividing by anything more than number/2 is just a waste of cycles....
I don't believe any of them are online.
I did find the 2nd edition on Amazon for approximatley $65. If you're going to program in a *nix environment, I'd recommend getting it.
Actually,...
Prelude,
Thanks for the update. Stevens books have always been a very helpful part of my reference shelf, and I was dismayed that he wouldn't be around to bring them up to date.
I'll...
As I recall there's a book by the late W. Richard Stevens called "Advanced Programming in the Unix Environment."
It has been a while since I picked it up, but as I recall, among other things, it...
And horsecrap put in a pretty bag with a bow on it is still horsecrap.
You're certainly not making it easier for folks trying to help you.....
There's a program on Linux (and other Unix systems) called "cdecl" which can help with C declarations.
Here's what I got with your line:
cdecl> explain int (* array[3]) (int sUP3r) (int blue);...
As Prelude told you earlier, take a look at the coding style of some of the folks who've been around here for a while -- Salem and Dave_Sinkula come to mind, among several others.
Why is coding...
Also, FWIW, you don't need to know C++ to code Perl.
I picked up Perl before I moved into the C++ world, but I had been a C programmer for quite a long while.
If you want to learn Perl, pick up...
Darn, Salem, you beat me to it.
I cut my "C teeth" on VAXen, and when I switched to Unix (well, DEC's Ultrix at that time) it felt strange to look for 0 for success and 1 for failure.
I believe...
BTW, there are other errors with your program.....
char fileName;
char buf[BUFSIZ];
char *p;
printf("what do you want the .html file to be saved as?");
if...
You cannot use print format specifiers (i.e. "%s") in the file name argument to fopen.
What itsme86 was saying was to create the filename string, using sprintf, and then pass that string as an...