Search:

Type: Posts; User: murjax

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    9,312

    Ok, that makes sense. I'm getting a syntax error...

    Ok, that makes sense. I'm getting a syntax error where I declare the function though.


    Array = GetChar (NumChar, MaxNumChar []);
  2. Replies
    4
    Views
    9,312

    Passing Variable-Length Array to a Function

    int GetChar (int NumChar, int MaxNumChar [NumChar])
    {

    printf("Please enter desired characters.\n");
    for (int i = 0; i < NumChar; i++)
    scanf("%c", &MaxNumChar[i]);

    return i;
    }
  3. Replies
    24
    Views
    5,646

    Ok now it works. Thanks.

    Ok now it works. Thanks.
  4. Replies
    24
    Views
    5,646

    There are spaces between every item in the file....

    There are spaces between every item in the file. Here are the contents of the file.

    0101 41 8.11 Y 49
    0722 32 7.22 N 40
    1273 23 5.43 Y 39
    2584 14 6.74 N 45
  5. Replies
    24
    Views
    5,646

    It seems to be. Putting any other value in makes...

    It seems to be. Putting any other value in makes the printf statement print nothing.
  6. Replies
    24
    Views
    5,646

    That makes sense, except now I have the same...

    That makes sense, except now I have the same problem I had before, printing the first 3 numbers correctly and then printing addresses for everything else.
  7. Replies
    24
    Views
    5,646

    More trash I see. It seems like it's printing the...

    More trash I see. It seems like it's printing the address of the variable instead of printing the value of the variable. Is it not reading the file properly?
  8. Replies
    24
    Views
    5,646

    There are 4 lines and no, the return isn't...

    There are 4 lines and no, the return isn't supposed to be part of the loop, which is why I originally had a ; at the end of the last line.
  9. Replies
    24
    Views
    5,646

    Here's the current piece of code. void...

    Here's the current piece of code.


    void GetFile (int* EmployNum1, int* Dep1, float* PayRte1, char* Exempt1, int* Hours1, int* EmployNum2, int* Dep2, float* PayRte2, char* Exempt2, int* Hours2,...
  10. Replies
    24
    Views
    5,646

    Removing the ; from the while statement and...

    Removing the ; from the while statement and changing 1 to the number of items being read (20 in this case) doesn't change a thing.
  11. Replies
    24
    Views
    5,646

    What's the garbage? The contents of the file?

    What's the garbage? The contents of the file?
  12. Replies
    24
    Views
    5,646

    Well here's the thing, it prints the first 3...

    Well here's the thing, it prints the first 3 items, skips the character item after it, and then prints a few random numbers for the 5th item which was supposed to be a 2 integer number.
  13. Replies
    24
    Views
    5,646

    Printf not printing all data

    The data in this program comes from a text file. It seems to read fine but when I try to print it only a portion of the data prints. I think I'm overlooking something but I can't put my eye on it.
    ...
  14. Replies
    3
    Views
    3,797

    That was the problem. I thought it was something...

    That was the problem. I thought it was something simple I was forgetting. Thanks.
  15. Replies
    3
    Views
    3,797

    Addition problem in loop

    Hi, I'm a beginner programming and have run into a problem on a project. Here's my loop.

    while(scanf("%d", &x) != EOF)
    {
    a = 1 / x;
    b += a;
    c = d / b;

    d++;
Results 1 to 15 of 15