cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Syntax Question
Syntax Question
Nov 3, 2011 at 7:10pm UTC
aruawons
(20)
#define foo(buf, data) *(buf)++ = (char)(data)
Can someone help to explain the above syntax of the token string:
*(buf)++ = (
char
)(data)
?
It works but I just don't understand what it does.
Thanks!
Nov 3, 2011 at 7:28pm UTC
Caligulaminus
(201)
The cast to
char
value of
data
is copied to the position
buf
points to, afterwards
buf
is incremented by 1.
Topic archived. No new replies allowed.