Click here to Skip to main content
16,006,564 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to convert string to BYTE array? Pin
SandipG 21-Aug-08 21:29
SandipG 21-Aug-08 21:29 
AnswerRe: How to convert string to BYTE array? Pin
Nibu babu thomas21-Aug-08 21:39
Nibu babu thomas21-Aug-08 21:39 
QuestionRe: How to convert string to BYTE array? Pin
CPallini21-Aug-08 21:45
mveCPallini21-Aug-08 21:45 
AnswerRe: How to convert string to BYTE array? Pin
kapardhi21-Aug-08 21:58
kapardhi21-Aug-08 21:58 
QuestionRe: How to convert string to BYTE array? Pin
CPallini21-Aug-08 22:03
mveCPallini21-Aug-08 22:03 
AnswerRe: How to convert string to BYTE array? Pin
kapardhi21-Aug-08 22:07
kapardhi21-Aug-08 22:07 
GeneralRe: How to convert string to BYTE array? Pin
Nibu babu thomas21-Aug-08 22:57
Nibu babu thomas21-Aug-08 22:57 
GeneralRe: How to convert string to BYTE array? Pin
CPallini21-Aug-08 23:02
mveCPallini21-Aug-08 23:02 
Well, for instance, using plain C (working on even-lenght hex strings, error checking omitted)

void main()
{
  char * str = "FFDA0890DA";
  int i, size;
  int k;
  BYTE  * b;

  size = strlen(str) / 2;
  b = (BYTE*) malloc(size * sizeof(BYTE));

  for (i=0; i<size;>  {
    sscanf(str+2*i, "%2x",  &k);
    b[i]= (BYTE) k;
  }
  for (i=0; i<size;>  {
    printf("b[%d] = 0x%02X\n",i, b[i]);
  }
  free( b);
}

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

QuestionPlease Guide Connect Sqlserver with VC++6.0. thanks very much Pin
aa_zz21-Aug-08 21:05
aa_zz21-Aug-08 21:05 
AnswerRe: Please Guide Connect Sqlserver with VC++6.0. thanks very much Pin
Hamid_RT21-Aug-08 21:14
Hamid_RT21-Aug-08 21:14 
GeneralRe: Please Guide Connect Sqlserver with VC++6.0. thanks very much Pin
aa_zz21-Aug-08 21:36
aa_zz21-Aug-08 21:36 
GeneralRe: Please Guide Connect Sqlserver with VC++6.0. thanks very much Pin
Hamid_RT21-Aug-08 23:43
Hamid_RT21-Aug-08 23:43 
QuestionHow to create a 'setup' installation CD for a simple win32 C app. Pin
glyfyx21-Aug-08 21:01
glyfyx21-Aug-08 21:01 
AnswerRe: How to create a 'setup' installation CD for a simple win32 C app. Pin
Hamid_RT21-Aug-08 21:17
Hamid_RT21-Aug-08 21:17 
AnswerRe: How to create a 'setup' installation CD for a simple win32 C app. Pin
Nuri Ismail21-Aug-08 22:09
Nuri Ismail21-Aug-08 22:09 
GeneralRe: How to create a 'setup' installation CD for a simple win32 C app. Pin
Michael Schubert21-Aug-08 22:32
Michael Schubert21-Aug-08 22:32 
GeneralRe: How to create a 'setup' installation CD for a simple win32 C app. Pin
glyfyx22-Aug-08 22:26
glyfyx22-Aug-08 22:26 
GeneralRe: How to create a 'setup' installation CD for a simple win32 C app. Pin
Michael Schubert23-Aug-08 1:14
Michael Schubert23-Aug-08 1:14 
QuestionInvisible UI + background process Pin
dharani21-Aug-08 20:47
dharani21-Aug-08 20:47 
AnswerRe: Invisible UI + background process Pin
_AnsHUMAN_ 21-Aug-08 20:54
_AnsHUMAN_ 21-Aug-08 20:54 
AnswerRe: Invisible UI + background process Pin
SandipG 21-Aug-08 21:07
SandipG 21-Aug-08 21:07 
QuestionAuto number in ID field with Primary key in MS-Access !! Pin
Le@rner21-Aug-08 20:39
Le@rner21-Aug-08 20:39 
Question[Message Deleted] Pin
Dhiraj kumar Saini21-Aug-08 20:37
Dhiraj kumar Saini21-Aug-08 20:37 
AnswerRe: store LPARAM value in a char buffer of size 1000000 Pin
SandipG 21-Aug-08 20:57
SandipG 21-Aug-08 20:57 
AnswerRe: Oh Why Pin
toxcct21-Aug-08 21:35
toxcct21-Aug-08 21:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.