I have a file I'm opening. This info looks like this:
123 725
205 115
and so on. There is a space between the two numbers. When I use fscanf I get the first number, but I get a negative # for the second number. But if I try to store the space I still get a negative #. This is that part of the code:
status = fscanf(inp, "%d%d", &CustNumb, &KWHUsedForCust);
CustNumb is always right, but KWHUsedForCust is a negative #.
Can anyone help?
Thanks!
Erica
123 725
205 115
and so on. There is a space between the two numbers. When I use fscanf I get the first number, but I get a negative # for the second number. But if I try to store the space I still get a negative #. This is that part of the code:
status = fscanf(inp, "%d%d", &CustNumb, &KWHUsedForCust);
CustNumb is always right, but KWHUsedForCust is a negative #.
Can anyone help?
Thanks!
Erica