Problem with fprintf and binary search.

This is a discussion on Problem with fprintf and binary search. within the C Programming forums, part of the General Programming Boards category; Thanks for the help, I figured it out....

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    9

    Problem with fprintf and binary search.

    Thanks for the help, I figured it out.
    Last edited by tallgeese84; 12-06-2004 at 09:33 PM.

  2. #2
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511
    Well two things

    Code:
    fprintf(outpt,"%ch",&ch);
    %ch is not a format specifier

    2. Why are you messing with characters when the program reads in integers?
    Mr. C: Author and Instructor

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    9
    I was just trying to go by an example of what my instructor gave me. He used that in his example, and I didnt understand the significance. I tried it with %d, but with no results. The output file ended up with 4 or 5 random numbers in it.

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    9
    This is what I get when changing to %d.

    1244624

    I think im close, but am still stuck.

  5. #5
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Please do not delete the information from your posts when your problem is solved. No one can learn from your problem in future.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Text file versus Binary file
    By sherwi in forum C Programming
    Replies: 6
    Last Post: 04-15-2006, 03:41 PM
  2. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  3. problem in MySQL with VC++6 in Win2000
    By psa_cprog in forum C Programming
    Replies: 4
    Last Post: 05-26-2005, 04:29 AM
  4. Print binary numbers to disk file, problem
    By Guti14 in forum C Programming
    Replies: 4
    Last Post: 10-04-2004, 08:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21