Solved

how to make a macro from this-EASY

Posted on 2004-09-25
2
187 Views
Last Modified: 2010-04-01
Hi,
I tried to make a macro of this function: HPRINT(temp)
where the function is:
-----
{for (int i=0;i<strlen(temp);i++)printf("%02x00",(temp[i]) & 0xFF);}
-----
I can't get it to work. Does anyone knows what I'm doing wrong??
0
Comment
Question by:zeugje
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 50 total points
ID: 12151933
It appears to work well, I have tested:

#define HPRINT(temp) {for (int i=0;i<strlen(temp);i++)printf("%02x00",(temp[i]) & 0xFF);}
0
 

Author Comment

by:zeugje
ID: 12152005
Hmmm.....
I defined HPRIN
and tried to run HPRINT....

Thanks for your help.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question