Thread: invalid source character: <0xffffff80>

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    57

    Unhappy invalid source character: <0xffffff80>

    Hey guys, I have this program done but it is saying that I have an invalid source character: <0xffffff80> on line 71. I don't get it, i have every other one the exact same?

    Code:
    #include <stdio.h>
    
    int main (void)
    {
    int number;
    int n0 = 0;
    int n1 = 0;
    int n2 = 0;
    int n3 = 0;
    int n4 = 0;
    int n5 = 0;
    int n6 = 0;
    int n7 = 0;
    int n8 = 0;
    int n9 = 0;
    
    
    FILE *dPtr;
    
    if ((dPtr=fopen("data.txt", "r"))==NULL){
            printf("File could not be read\n");
            }
    
    else{
            printf("Enter the numbers:\n");
            fscanf(dPtr,"%d", &number);
    
            while (number != -1){
    //      printf("%d\n", number);
            fscanf(dPtr,"%d", &number);
    
    
    if (number <= 10)
    n0++;
    else
    if (number <=20)
    n1++;
    else
    if (number <=30)
    n2++;
    else
    if (number <=40)
    n3++;
    else
    if (number <=50)
    n4++;
    else
    if (number <=60)
    n5++;
    else
    if (number <=70)
    n6++;
    else
    if (number <=80)
    n7++;
    else
    if (number <=90)
    n8++;
    else
    if (number <=100)
    n9++;
    }   
    fclose(dPtr);   
    }
    
    printf("Range\tFrequency\n");
    printf("0-10\t%d\n11-20\t%d\n", n0, n1);
    printf("21-30\t%d\n", n2);
    printf("31-40\t%d\n", n3);
    printf("41-50\t%d\n", n4);
    printf("51-60\t%d\n61-70\t%d\n", n5, n6);
    printf("71-80\t%d\n81-90\t%d\n", n7, n8);
    printf("91-100\t%d\n", n9);
    
    return 0;
    }
    i just don't understand where i went wrong.

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    57

    Question help....?

    does any one know why this isn't working. I mean i am sure it is hard for you guys to compile because you don't have the program that writes the data. You just have the program that reads it. But is there any reason why this isn't working properly?

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    57

    Talking found it. Thanks anyway

    I found the problem, thanks to those who viewed the thread. I don't know why I did that incorrectly. Have a good night.!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to build, run Boland C++ 6 source file via VS2005?
    By userpingz in forum C++ Programming
    Replies: 2
    Last Post: 05-21-2009, 03:25 AM
  2. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  3. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  4. get wide character and multibyte character value
    By George2 in forum C++ Programming
    Replies: 27
    Last Post: 01-27-2008, 05:10 AM
  5. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM