Solved

how to make a macro from this-EASY

Posted on 2004-09-25
2
184 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
Comment Utility
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
Comment Utility
Hmmm.....
I defined HPRIN
and tried to run HPRINT....

Thanks for your help.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now