preprocessor


Save string in C preprocessor


We have following macros:
#define START(x) [...]
#define FOO(x, a, b, c) [...]
#define BAR(x, a, b, c) [...]
#define END(x) [...]
We have piece of code:
START(foobar)
FOO (foobar, 1, 2, 3)
FOO (foobar, 0.1, 0.2, 0.3)
BAR (foobar, 2, 3, 4)
END (foobar)
Can we do something to let START store foobar somewhere? To xform previous into:
START(foobar)
FOO (1, 2, 3)
FOO (0.1, 0.2, 0.3)
BAR (2, 3, 4)
END ()
(something like #define FOO(x) #define VAR x)
What about:
definition:
#define START() [...VAR...]
#define FOO(a, b, c) [...VAR...]
#define BAR(a, b, c) [...VAR...]
#define END() [...VAR...]
usage:
#define VAR foobar
START()
FOO (1, 2, 3)
FOO (0.1, 0.2, 0.3)
BAR (2, 3, 4)
END ()
#undef VAR

Related Links

Pre-process Laravel 4 view
File iteration with the preprocessor
processing strings of text for neural network input
How to Set Active Target in XCode 4.5+
Preprocessor assertions in arduino
expanding a macro within a macro definition
GNU-M4: Strip empty lines
Escaping space in OpenCL compiler arguments
Does Corona have preprocessor statements so I can execute Lua code for specific devices?
Preprocessing in C++
Truncate string in cpp (preprocessor)
C++ precompiler conditionally include code
DDK preprocessor directives
Preprocessor, Postprocessor, Geometric Processor and NC processor
Gfortran pre-processor directives for Different Operating systems
Good data set for Pre-processing

Categories

HOME
kentico
telegram
powerpoint
saml-2.0
error-handling
owl-carousel
appcelerator
computer-science
octave
commonjs
watson-conversation
openbugs
intercom
http-post
keytool
event-sourcing
azure-iot-hub
esoteric-languages
babel
named-entity-recognition
angular-routing
qliksense
xcode-ui-testing
shared
appirater
genexus-sd
android-things
winexe
bringtofront
magento-1.8
dotspatial
send
utorrent
gnat-gps
arduino-ide
jwplayer6
imx6
openerp-7
projects-and-solutions
password-protection
news
signals-slots
numberpicker
bindingnavigator
monkey-testing
mesosphere
opennms
dotnet-httpclient
datamaps
reshape
monkey
offline.js
pocketsphinx-android
donations
winusb
centrifuge
vulcanize
jtwig
embedding
http-status-code-401
cda
dbamp
redis-cluster
pushbots
blitline
phpgrid
ascii-art
concurrentmodification
iokit
roadkill-wiki
video-player
android-launcher
coda
linked-tables
broadband
webmatrix-3
filesplitting
ghcjs
contrast
verold
koala
git-repo
ecslidingviewcontroller
gwt-openlayers
android-usb
jquery-1.9
sqlclr
nokia-s40
os.system
jqote
office-2007
int64
technical-debt
appliance

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App