TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: All
from: Joshua Marshall
date: 1996-12-09 11:29:06
subject: sprintf function

Can somebody tell me the easiest way to do this:

I want to insert a character into a string.  I have tried:

  sprintf(string, "%c%c%s", string[0], '0', string+1);

however if string is "TEST" instead of "T0EST" I am
getting "T0000"

This is using SAS/C v 6.57 for the Amiga.  Can somebody tell me if it's
just the compiler?

 Josh Marshall   Fidonet   3:640/201.14
  ->MEMBER<-     Internet  joshua{at}st.net.au
  Team Amiga     Amiganet  41:400/869.14

... In this world a man must either be anvil or hammer.
--- Mail Manager 1.21x/p #1219
* Origin: Borderline Technologies (3:640/201.14{at}fidonet)
SEEN-BY: 633/267 270
@PATH: 640/201 201 820 711/409 808 50/99 635/728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.