I have to convert word datatype into char* to pass in a function.
Could anyone show me how to do it. IT should be in C and not C++.
Also I need to pass into function something like
2000-3000-2
where 2000 = word datatype
3000 = word datatype
2 = word
and “-”
while function takes char* as an argument.
so basically i need to convert above combination of word datatype into char*.
Any help or criticism will be helpful
You are looking for
sprintf(), perhaps something like this:where
w1,w2andw3are integer variables holding values 2000, 3000 and 2 in your example.