Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Please help..

Please help..

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sardinka
    wrote on last edited by
    #1

    I have the following procedure where I am converting the first alphanumeric value to appropriate numeric (alphanumeric value is always first position). How should I change the procedure accordingly if alphanumeric value can be on any position? DBCHAR Modifier[4]; int convert_char_modifier(char *Modifier, char *NewModifier) { char NewMod2[8]; char Tempcrap[8]; char Tempcrap1[8]; memset(NewMod2,0x00,sizeof(NewMod2)); memset(Tempcrap,0x00,sizeof(Tempcrap)); memset(Tempcrap1,0x00,sizeof(Tempcrap1)); sprintf(NewModifier, "%02d", Modifier[0] - 64); sprintf(Tempcrap1, "%d", Modifier[1] - 48); strcpy(Tempcrap, Tempcrap1); sprintf(Tempcrap1, "%d", Modifier[2] - 48); strcat(Tempcrap, Tempcrap1); sprintf(NewMod2, "%03s", Tempcrap); strcat(NewModifier, NewMod2); return(0); } Here my examples what I am trying to accomplish: A03-01003 B10-02010 1AD-11030...for the next letter add 10,len of result no more then 5.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups