Thank you so much nonoob. :)
Problem solved.
edit:
Thank you as well anduril462, I appreciate it regardless :P
Type: Posts; User: MC++
Thank you so much nonoob. :)
Problem solved.
edit:
Thank you as well anduril462, I appreciate it regardless :P
Hello again,
I've got another issue. This time I'm having trouble calling a function and the problem lies in the string (char) variables.
The errors I get when trying to compile:
126:1 [Warning]...
Well after I stopped using the array for prate, yes. Everything is working as it should I was just trying to figure out if I could store the prate values in its own array, but after looking at what...
What do you mean? Paygroup is decided based on what is scanned from a file.
For example:
0001:Johnson:Joe:6:38.0
See that '6' after Joe: ? That's the paygroup, however because that is the...
The odd thing was that for the very last output it actually gave a number, but it was still incorrect. Every other time it was 0, yes. The problem I think was that the for loop was confused due to...
Most of the code:
void payrate(double *rate);
void Summary();
main()
{
FILE *fp2;
Yes prate is an array of doubles.
nonoob, I saw that mistake. But it's not necessarily relevant because nothing else is working either.
Hey guys, got a quick problem. I'm having trouble assigning the correct value to an array variable. It's just outputting 0.
edit:
I realized the problem. It's the fact that prate[n] gets messed...
I'm sorry to bother you so much, but can you give me an example if mine is wrong?
is it simply:
array[0] == array[1]
Thank you so much for all your help today Quzah. You are like a wizard, and...
I already changed the array size to 10. Took care of that one a while ago, sorry I didn't mention that.
Can you help me with my latest issue? Around 2 posts prior to yours.
Okay Mr.Quzah I think I figured that out but I've got another question for you:
Right now I have a "paygroup" and "payrate".
Now, for example:
Payrate 1 is 7.75
Payrate 2 is 8.00
Here's...
But how do I pass the arrays when I call the function in main? I'm not understanding this part.
Here is my code:
void payrate(double *rate);
void Summary();
main()
{
I actually changed it anyway. Thanks for the tip brother! Congrats on your 1,000th post btw. I'm honored to have received it in my thread :P
OMG! Thank you so much. The funny thing is I had the 2-dimensional array idea in my mind but I am afflicted with such terrible memory that I actually forgot about it and never tried it until you...
Okay, here is most of my code:
main()
{
FILE *fp1;
FILE *fp2;
int i, n;
double payrate[10];
Thank you very much for the response. My code looks like this now:
for(n=0;n<6;n++){
fscanf(fp2, "%d:%[^:]:%[^:]:%d:%lf\n", &empnum[n], lastn[n], firstn[n], &paygroup[n], &hours[n]);
...
I'm having a lot of trouble today unfortunately.
I've got another issue now. I need help with scanning and recording strings in a file.
The file looks something like this:...
I've tried the change you mentioned but it's still not working. The code is now:
void payarray(double *payrate[10]);
void Summary();
main()
{
double payrate[10];
int n;
I'm lost here and I don't really understand what the problem is. If someone could point it out real quick I'd be very grateful!
void payarray(double *payrate[10]);
void Summary();
main()...
Even when I put the ampersand into the fscanf the readouts are still always 0.00
Right now I'm just trying to get a single one working. I know I need to make it into a for loop.
Is there any...
Hello everyone, right now I'm having some trouble with reading data from a file (just a .txt).
So far what I've got is:
#include <stdio.h>
#include <stdlib.h>
main()
Basically the program operates like this:
Enter value for Vowels: %d \n
Enter value for Consonants: %d \n
Enter string: %s \n
Total for vowels: %d \n
Total for consonants: %d \n...
Thank you for the response, Niara. It sheds a little light, but I am still very new to C programming unfortunately and so I am still a little lost.
Is there a resource you can guide me to that...
Hello guys,
I was wondering, how do you build a program that will assign certain values to certain characters and different values to others?
For example, if I wanted to assign a value of 1 to...
I might have forgotten to include something in the code I uploaded here, but it compiles fine on my end and I've actually solved the problem.
I am unable to edit my initial post anymore due to the...