Thread: fprintf problem

  1. #1
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140

    fprintf problem

    hi

    i want my program to write the following line in a file:

    Spooler_drucker=\\A145023\OkiML310

    i tried the trigraph ??/ but it is not working, too.

    the program compiles with the compiler-warning "unknown escape sequence". after running the exe the program writes the file without \ and \\ when i try
    fprintf(data_ptr,"Spooler_drucker=\\A145023\OkiML3 20\n");
    and with the trigraphs when i try
    fprintf(data_ptr,"Spooler_drucker=??/??/A145023??/OkiML320\n");

    all other lines are working fine - just this damn \\ thing *sigh*

  2. #2
    Unregistered
    Guest
    Did you try " \\A145023\\OkiML320"?

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    If you want to write the "\\" you will have to use "\\\\" so it doesn't think it's an escape sequence. That should work.
    1978 Silver Anniversary Corvette

  4. #4
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140
    oh i see

    / is // and // is ////

    thanks alot

  5. #5
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    No problem.
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. Problems writing some chars to files with fprintf
    By Nazgulled in forum C Programming
    Replies: 3
    Last Post: 04-18-2006, 06:00 PM
  3. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  4. help with basic program
    By JOlszewski in forum C Programming
    Replies: 3
    Last Post: 02-01-2006, 04:19 PM
  5. Replies: 5
    Last Post: 11-07-2005, 11:34 PM