I was under the impression that BUFSIZ is the size of the buffer, however, if you declare an array and make it's size bufsiz, then use fgets(array, BUFSIZ, stdin); it still seems possible to overflow...
Type: Posts; User: Ash1981
I was under the impression that BUFSIZ is the size of the buffer, however, if you declare an array and make it's size bufsiz, then use fgets(array, BUFSIZ, stdin); it still seems possible to overflow...
Hi all, here's the source code from my first "real" program, hope you enjoy it :)
Thanks to all of you who helped, w/o your help, certainly couldn't have done it.
I was gonna go post it under...
Oh one more thing, if anybody happens to read this, you know how you can usually right click on a program and select properties under winx, and it will allow you to change the icon of the program,...
thanks for the replies, i'm still modifying the source code a bit, then i'll post it :)
btw, I had a couple of other small questions that have been bugging me:
Is there a way to convert a...
I was noticing that if you use sizeof to get the size of a char array that is not from to the function you are calling it from, it doesn't work. Even if you have a function that takes in a string,...
Thanks that was incredibly helpful, and I think I see what you mean, thanks for taking the time to look thru that mess, I'm definatly gonna code it more consistantly now :)
Oh, ok thanks. i'm not using UNIX, just winxp :)
thanks for the info, it's greatly appreciated. But I noticed that in my program above, it has crazy bugs if i just do "getnum(max)", but if I do "return getnum(max)", it's fine. Do you usually do...
thanks, you rock!
Also I was hoping you could tell me exactly how that works, and a way to make it so that I could make it go off at a certain time if possible. Sorry to ask, but google wasn't much help, and I didn't...
Thanks much!
And actually I think I just awnsered my other question as well, I changed them all to return getnum and now things are working awesome, I'm gonna hook you and salem and cvr and some other helpful...
LOL, nevermind, I had missed a line which I went back to and changed to "return getnum", now it's working much better, sorry about that!
Also I had been making a smaller program to illustrate the same problem as in the code above, and I made the changes to it, and if you look at it, you'll see it's still functioning weird, if I could...
Great thanks sooo much, it works now! But I'm just curious, why is it that you just changed that one line to "return getnum(max)", but left the others still just as "getnum(max)"? I was wondering if...
Ok well hey thanks for that, I'll definatly do that. I should know better, but I was so excited and in such a hurry to make this program, that I didn't remain consistant. I appreciate the help on the...
Oh yeah, and it says "returning to function" but then it doesn't execute the very next line, which is "return input;", it skips about 10 lines up in the code for no apparent reason!
I'm starting...
sorry for all the //'s -- they are there from where i was upgrading it, and of course the info under "about" in the program isn't quite true yet, I have no registered or deluxe version.
Here's...
Hi, sorry that this is such a large program, but I was putting together what I learned, and so I made a function that would read in a number from the user, and perform some input validation, then...
I was wondering if there was a function to return the system time, I just wanted to make a simple alarm clock program that would go off at a certain time.
Thanks,
Ash
When clearing the screen using the win32 console, with windows.h, there is a command called FillConsoleOutputCharacter and one of the arguments is how many characters to output. I noticed that for my...
thanks all
I just got off work, and am just online real quick while I can be, I'm gonna save this page and view it later and try what you guys said (after I get some sleep - I work graveyard - thanks a lot for...
Anyone happen to know why this is? Thanks, Ash
/* Anytime you want to use input validation, always make the char array 2 bigger than what you need or it won't work.I'm
not sure why this is...
I've been reading up on fopen and fclose and all, and I was wondering if there was a way to open a text file and modify a character a certain amount of places into the file...for example, open a text...