?
Solved

how to make a macro from this-EASY

Posted on 2004-09-25
2
Medium Priority
?
191 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 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 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.

777 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