I'm working on an audio application, written in C. I need to provide live audio playback under Windows. I need to decide which audio API to use. I'm planning to use the basic waveOut API, but I wanted to check to see what the community here recommends.
I want code that will Just Work on any recent version of Windows, with no need to ...
I need an explanation of advance kalman filter algorithm. Preferably a C code, but only the algorithm will work for me.
...
I'm a beginning learner of C currently reading K&R. I was debating whether I should constantly post questions about things that confuse me in the 2nd edition of K&R (ANSI C) or find someone whom I can turn to specifically to ask questions whenever I stumble upon a confusing sentence or paragraph.
Finally I have decided to choose the lat...
Please provide some code for converting char[] array of decimal values to bytes array for big integer value in c.
How can I convert this below code for big array of decimal value, such as I get the result as array of long bytes?
static int dec2bin (char inbuf[], int num_convert)
{
char ctemp;
int result, power;
num_convert--; /*...
Does anyone have handy the snippets of code to convert an IEEE 754 double to the immediately inferior (resp. superior) float, without changing or assuming anything about the FPU's current rounding mode?
Note: this constraint probably implies not using the FPU at all. I expect the simplest way to do it in these conditions is to read the...
Hi.
I want to compile an application with debug information using gcc and gdb. When I do the following, the debug (.dSYM) files are generated correctly:
gcc -ggdb src/test.c -o build/test
If I, however, split this into a compile step and a link step, like this:
gcc -ggdb -c src/test.c -o build/test.o
gcc -ggdb build/test.o -o dist/b...
I'm trying to get the stack backtrace of a running process (PID and binary path are known) from another program. The program in question is written in C++ and compiled with g++ with gdb debugging symbols.
I'm looking for a C or C++ library that works across Linux, HP-UX and Solaris that produces an output similar to the output of callin...
It's known that big local/global variables may cause to a stack overflow.
I know that using pointers and allocating space in memory helps to overcome this problem.
But is it the only option? What happens if I have (or need) too-many pointers in global scope?
Regarding the stack space: Is a global struct-type variable takes space in the ...
My C project uses preprocessor directives to activate / deactive some features. It's not unusual to find some of the less common configurations do not compile anymore due to a change made a few days ago within an #ifdef.
We use a script to compile the most common configurations, but I'm looking for a tool to ensure everything is compile...
hello, when you set a databreakpoint in MSVS, then you put in the address and the number of bytes and finally it lets you choose betwenn "C" and "C++".
this last part i dont know what it is about? what is the difference of picking C and C++ in this situation?
thanks!
...
Hi. First post here.
I've been fooling around with malloc, realloc and free in order to write some basic functions to operate on C strings (char*). I've encountered this weird issue when erasing the last character from a string. I wrote a function with such a prototype:
int string_erase_end (char ** dst, size_t size);
It's supposed to...
Assuming I have a struct like the following:
struct Struct {
char Char;
int Int;
};
and sizeof( int ) is greater than one and the compiler adds padding for the Char member variable - is the compiler-generated code allowed to change the values of the padding bytes?
I mean if I use pointer arithmetic and write some data into th...
I have a Server Client structure , both server and client can send and receive file. how to send and receive file in socket programming.
one solution that I think is partition the file and send one by one segment, is there any library for file send and receive in Linux and C/C++?
...
Hi,
I'm playing with C dlls to hook global Windows events and the next step is sending some event data (nothing huge) to a C# application.
As I want this communication to be as fast as possible, I'm analysing two options: Named Pipes and Memory Mapped Files.
I know that .NET 4 brings MMF in a native way, but I have to target .NET 2, a...
I remember reading a book talking about standard the C programming language. It said in some kinda C you can write i=+1 which equals i+=1. So i(operator)=(expression) equals i=(operator)(expression). I never see this kind of C, is there someone who can explain this?
Best regards and thanks,
Fan
...
Hi, this program accepts user input and saved to a char array. Then creates a file and put those texts to the new file. Problem is, it can only copy the part before space.
Current Output : "how to read" --> "how"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argv, ...
This program sorts input lines lexicographically, and I've come to this exercise in K&R:
Rewrite readlines to store lines in an array supplied by main, rather than calling alloc to maintain storage. How much faster is the program?
The original program is the same, just it used alloc to maintain storage for lines.
So I edited it th...
How I can use getchar() in a loop? Now I have...
for (p=0; p<n_players; p++) {
...
fflush(stdin);
getchar();
}
But it doesn't work... if n_players is 3, it execute getchar 2 times only at the end...
for (p=0; p<n_players; p++) {
blank_start();
ascii_art_title();
printf("%s, tocca a te...\n",player_info[p].play...
I do not understand what the difference is between calling recv() on a non-blocking socket vs a blocking socket after waiting to call recv() after select returns that it is ready for reading. It would seem to me like a blocking socket will never block in this situation anyway.
Also, I have heard that one model for using non blocking sock...
I'm trying to implement some inline assembler (in C/C++ code) to take advantage of SSE. I'd like to copy and duplicate values (from an XMM register, or from memory) to another XMM register. For example, suppose I have some values {1, 2, 3, 4} in memory. I'd like to copy these values such that xmm1 is populated with {1, 1, 1, 1}, xmm2 wit...