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 nee开发者_JAVA百科d 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:
sprintf(buffer, "%.4d-%.4d-%d", w1, w2, w3);
where w1, w2 and w3 are integer variables holding values 2000, 3000 and 2 in your example.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论