Thread: Printf Question
View Single Post
  #6   Spotlight this post!  
Unread 07-03-2004, 00:22
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Printf Question

Quote:
Originally Posted by Daniel
If you read the file "printf_lib.c" (I think) you will see a comment that says "%c" is not supported. The best you are going to do is put the character into a char array two long setting your character in location 0 and '\0' (or zer0) in location 1, then print it using "%s" as the format and using the array name.

char t [2];
t [0] = 61; // Or what ever you character is.
t [1] = '\0' // Null character.
printf ("%s\n", t);
yeah, try that... forgot about the null terminator, because i'm so used to just using strcpy gotten lax.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)