Forgive me for being vague in this question. I'm trying to help a co-worker out with a problem he's got. So from what I understand:
We have a variable of type double that is declared and...
Type: Posts; User: Hoser83
Forgive me for being vague in this question. I'm trying to help a co-worker out with a problem he's got. So from what I understand:
We have a variable of type double that is declared and...
Thanks slymaelstrom. I think it is time for me to take a break after that one.
Hey guys. Can you take a look at this program. It is suppose to calculate federal and city income taxes withheld for a certain pay period. I use a function to calculate this. It keeps telling me that...
That explains it. Thanks.
Hey guys. I just had a quick question. Could anyone tell me when a macro in a C program is expanded (such as a #define.... ). I am thinking that it's concurrently with the program compilation, but...
Thanks a bunch guys. After looking at it for quite awhile last night, I was able to make it work the same way spydoor has it set up. I was going to post that I had it working, but when I was done, I...
I totally agree with you quzah, but this is what I have to use. The only thing I have left to figure out is how to print the correct number of random numbers into the file using my for loop and using...
Yeah, I got it to work that way. Thanks. Hey Richie if you have time to look at this one last thing. It's the same program with some modifications I made so that if you input something like 46i...
okay, I got it so it will run, but my file will not open no matter what I put in there. Is this because of my cfopen function?
This is the first time I've ever done this so I don't know what to...
Hey guys. I have visualstudio.net as to write my code on. When I run this code, it doesn't let me enter the file. It just comes up with an error message that says that it can't find the specified...
Here is my entire code:
I'm not able to use my compiler right now so I'm just trying to get close:
My book has not gone over bases yet. That is why I'm sort of lost here.
If this does work,...
so base 10 equals a decimal integer?
This may be a dumb question, but what does the BUFSIZ mean. It that a default thing?
Okay, let me try that:
The way I have this now. It takes the string line, and the pointer pEnd, and also the base address.
If it comes to something other that a character before it reaches pEnd,...
no, it doesn't. It says that it take an nptr, endptr, and a base. I just need to figure out how to incorporate the pointers. Since it converts it to a long int, does this mean that if it encounters a...
If you think that this is the wrong application for strtol(), I won't disagree because I don't know for sure. I just want to make a check to see if the user inputs the right thing. for example: 461...
I'm not sure I totally understand. I thought that-
if( strtol( line ) != 1)
{
printf("\nERROR: Please enter positive integer.\n");
}
meant that if strtol...
Given this:
#define MAXLINE 100
and
int main(void)
{
I have a program that requires a user to input a number. The number determines how many random numbers(done by my program) will be displayed on the screen. The number input by the user will be of...
Thanks to both of you guys. 1. I can understand better how to actally call the function correctly. 2. I can see how the filename is passed around correctly.
Thanks again.
Here goes:
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void get_info(char *filename, int *n_ptr);
I fixed up the printf statement. The %s was wrong, and the other parentheses is at the end of the second sentence: "How many would you like to see?" I also changed the filename to an array.
This is what I have so far:
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
yes, sir. to a text file that the user also defines.
I am suppose to use these three functions in this program. They give cfopen, and we are to write gfopen. I think I have it correct. Should it not be there or is it incorrect?