Where can I find an existing implementation of sprintf? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I need to customize c++ sprintf function, after step into sprintf, i got _cfltcvt_l, but there isn't _cfltcvt_l source code in visual studio.
I did the same thing in g++, it lead me to __mingw_vsprintf function, but i don't know where __mingw_vsprintf is.
I know that glibc is one of the implements, after downloaded, i can't find any file related to sprintf, So could anyone tell me where can I find an existing implementation of sprintf?

There's quite a train of functions to follow in glibc:
First, there's sprintf which calls vsprintf which calls vfprintf which does all the work. I believe the io and _IO_ prefixes might be irrelevant. They might not be, in which case my answer is wrong.
On the MinGW-w64 side of things the train follows a different path:
First, you have mingw_sprintf, which calls __pformat or mingw_pformat which looks like it does all the work.
I never got to figuring out how BSD libc is structured, so I can't show you their implementation.

Seems this is what you searching:
https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=stdio-common/sprintf.c;hb=HEAD

Related

How to read MATHEMATICAL functions in C++? [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Okay, so what I want to do is to use a string as input (for instance "16*12+25"), convert it to a mathematical evaluation that the computer can comprehend and return the evaluated value. I could probably write this myself, but it would most likely take quite a while and in the end, it still wouldn't end up as good as I'd like it to unless I want to put even more time into it.
So my question is, is there any script, library or api that you know can do this for C++? I have found some for both java, python and .NET. But I am not working with any of these languages and I would like to remain within C++ for as long (hopefully throughout the entire project) as possible. Do you have any good ideas or links?
I found what I was looking for! The downloadable source is C++ and a CodeBlocks project. You can find it here: http://www.speqmath.com/tutorials/expression_parser_cpp/index.html
A far more sophisticated expression parser recommended by Jared: http://www.partow.net/programming/exprtk/index.html
There is nothing built into C++ for this; all the expression parsing code belongs in the compiler. You will need to use some external library. A quick Google search brings up muParser which looks pretty reasonable.

Reference to analyze the call dependencies in C/C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I want to analyze the c/c++ files for getting the dependencies through source codes. The data tells us which method in a file call to the other function in other file.
How can I accomplish? If you have good reference, Please share to me.
Thanks.
You can use different tool like doxygen , KCachegrind, gprof, Netbeans call graph for analyzing the dependencies.
https://en.wikipedia.org/wiki/Call_graph
I don't know if it meets your specific needs, but to create a callgraph, use the callgrind tool in valgrind:
valgrind --tool=callgrind
See here.
I think you can use ctags with cscope.

Is there a fiddle type thing for c++ and other languages? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I remember seeing once a jsfiddle type of thing (online compiler) where you can specify the language (c, c++, asm) and the input and output and it compiles it and displays the output from the website.
Anyone know what I'm talking about?
There are many, two most popularly used here in SO are:
Ideone.com
codepad.org
And all you have to do to find more is use google. A simple search yields thousands of results. I usually stick the two I mentioned above because I have seen them working reliably.
codepad and ideone?
You can try codepad, but it doesn't have input options afaik.
ideone is created for programming contests, like spoj, and allows input, output and file saving.
You can now find most of the fiddles at https://fiddles.io/

A tool to tell you what source files are needed in a C++ project? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am porting a large, messy, 10 year old cold base in C++ from Metrowerks on OS X to XCode. There are so many files and all the other people that touched this over the years are gone. Nobody know what files are actually needed and which are just cruft.
Is there any tool that I could run and have it produce a list of what files are ACTUALLY needed?
You could run doxygen on your project and have it generate inheritance diagrams for your classes. It can also generate caller graphs to help you find dead code.
You can try searching this static code analyzer list in Wikipedia. The ones that I've seen in actions would be cppdep and Include Hierarchy Viewer, although the first one is a little rough and the latter is a Windows analyzer only for the include tree. Also that still might not give you all the info if the dependencies are not explicit.
Edit: Also, the following StackOverflow search query seems to have results that might interest you:
https://stackoverflow.com/search?q=c%2B%2B+dependency

Library for software mixing of sound (wave) streams [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I would like to mix several sound (wave) streams into one.
Each stream might have a different format (bits/sample, channel count, etc.), so conversion is needed also.
I am looking for a library to do this, which I can link into my VS C++ project, before jumping in and implementing my own.
If you just want a library you can use the SOX library. It is pretty good and easy to use.
If you want more control over how the mixing is done, and maybe have more than 2 files to mix, you should take a look at the STK library
It is very simple yet quite powerful. The following is an example of how you can use a single line of code to mix two waves (simple superpositioning of the signals)
output.tick( input1.tick()*0.5+ input2.tick()*0.5 );
Hope this helps.
FMOD is quite good.