Solved

how to make a macro from this-EASY

Posted on 2004-09-25
2
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 135
Grammars for C C++ and java 1 140
Installshield for Embarcadero EX 10.1 Berlin 4 75
How to Correctly derive class from CWinThread in MFC 4 90
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

730 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