Hi,
I have a macro whose value is obtained from a combination of other
macros. E.g
#define ALL_TESTS \
INIT_TEST ("string one", 1) \
DEF_TEST("string two", 2)
Upon execution, the value of ALL_TESTS gets evaluated to something in
this format:
{"string one", 1, NULL}, {"string two", 2, NULL}
I want to cast the above into a string so that I can parse the string
and extract fields of interest. I tried #ALL_TESTS but this doesn't
seem to work.. Is there a way to get this working?
Thanks 2 3894
On Jul 13, 10:31 am, rpar...@gmail.com wrote:
Hi,
I have a macro whose value is obtained from a combination of other
macros. E.g
#define ALL_TESTS \
INIT_TEST ("string one", 1) \
DEF_TEST("string two", 2)
How are INIT_TEST and DEF_TEST defined?
>
Upon execution, the value of ALL_TESTS gets evaluated to something in
this format:
{"string one", 1, NULL}, {"string two", 2, NULL}
I want to cast the above into a string so that I can parse the string
and extract fields of interest. I tried #ALL_TESTS but this doesn't
seem to work.. Is there a way to get this working?
Please provide smallest possible code to demonstrate your question. It
helps more clear understanding of your problem (or requirement).
Mohan rp*****@gmail.com wrote:
Hi,
I have a macro whose value is obtained from a combination of other
macros. E.g
#define ALL_TESTS \
INIT_TEST ("string one", 1) \
DEF_TEST("string two", 2)
Upon execution, the value of ALL_TESTS gets evaluated to something in
this format:
{"string one", 1, NULL}, {"string two", 2, NULL}
I want to cast the above into a string so that I can parse the string
and extract fields of interest. I tried #ALL_TESTS but this doesn't
seem to work.. Is there a way to get this working?
Not tested, but probably good:
#define STRINGIZE(s) STRINGIZE2(s)
#define STRINGIZE2(s) #s
#include <stdio.h>
....
printf("%s", STRINGIZE(ALL_TESTS));
--
Thad This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike Vieths |
last post by:
I'm running into a problem when I try to run commands with os.execv. It
seems to be putting quotation marks around each element of the list
passed as its second argument. This is fine for the...
|
by: (PeteCresswell) |
last post by:
Is his just a flat-out "No-No" or is there some workaround when it comes time
for SQL searches and DAO.FindFirsts against fields containing same?
I can see maybe wrapping the value searched for...
|
by: Tim Mulholland |
last post by:
I have an issue i can work around, but i'm trying to figure out what i'm
"supposed" to do.
i have a line of HTML/ASP.NET code inside a repeater that is something like
this
<a...
|
by: Donlingerfelt |
last post by:
I would like to download stock quotes from the web, store them, do
calculations and sort the results. However I am fairly new and don't have a
clue how to parse the results of a web page download....
|
by: drew007 |
last post by:
Hi all
I am looking to drop data into a table for export to a csv file for example see below.
DoCmd.RunSQL "SELECT Temp11.RowNum As RowNum, " &_
"Replace(Temp11.studEnrolment1,',','') AS...
|
by: adam.timberlake |
last post by:
This is a really basic question for all you people out there who know
PHP. This is not a problem but just something I'm confused about. I
was reading the article below and wondered why are normal...
|
by: maryanncanor |
last post by:
Hi I would like to know if there is a macro that can export the data from a query to an output textfile that has NO QUOTES.
If I run the concatenated query Expr1: & & & & & & &
...
|
by: RvGrah |
last post by:
If I add "string args" to the Program.cs file so that there can be
arguments passed when the program launches, how do I add those to a
fixed desktop shortcut on my users' machines? And If I'm...
|
by: ncsthbell |
last post by:
I am trying to construct a 'Copy' statement in Access 2000 vb that I will actually write out to create a .bat file. My problem is that I need to put quotes around the vcFileFrom and vcFileTo...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |