I'm attempting to compile SndObj, and I need some header files. Which Debian packages do I need to obtain all the missing header files?
Checking for C header file alsa/asoundlib.h... (cached) no
Checking for C header file soundcard.h... (cached) no
Checking for C header file jack/jack.h... (cached) no
Checking for C header file m_pd.h.....
In errno.h, this variable is declared as extern int errno; so my question is, is it safe to check errno value after some calls or use perror() in multi-threaded code. Is this a thread safe variable? If not, then whats the alternative ?
I am using linux with gcc on x86 architecture.
...
I want to read a int from stdin but I want to validate if the user exceeds the int max value. How can I do it?
int n;
scanf("%d", &n);
scanf reads the decimal input and stores in the int, causing overflow. How can I check and avoid this?
...
My current understanding of conditional variables is that all blocked (waiting) threads are inserted into a basic FIFO queue, the first item of which is awakened when signal() is called.
Is there any way to modify this queue (or create a new structure) to perform as a priority queue instead? I've been thinking about it for a while, but...
Yesterday I asked a floating point question, and I have another one. I am doing some computations where I use the results of the math.h (C language) sine, cosine and tangent functions.
One of the developers muttered that you have to be careful of the return values of these functions and I should not make assumptions on the return values...
Hello,
Until now I've been only writing console applications but I need to write a simple window application for a school assignment.
Could somebody point me to a good tutorial how to create windows and other ordinary windows elements such as buttons, 2d graphs ect in ANSI C? is there some good library I should use?
I tried googling b...
Hi everyone,
I need to translate what is commented within the method, to assembler. I have a roughly idea, but can't.
Anyone can help me please? Is for an Intel x32 architecture:
int
secuencia ( int n, EXPRESION * * o )
{
int a, i;
//--- Translate from here ...
for ( i = 0; i < n; i++ ){
a = evaluarExpresion( *o );
o++;
...
Hi,
I'm trying to create a simple shell in C for Unix. I've been able to do all the parsing of commands and execution, but I'm having a problem with piping. I think the problem is that I'm not hooking into the correct pipe for the input of the second command.
For example, if I type "ls | wc", it will pause after the "wc" command, which...
I wrote this function to get a pseudo random float between 0 .. 1 inclusive:
float randomFloat()
{
float r = (float)rand()/(float)RAND_MAX;
return r;
}
However, it is always returning 0.563585. The same number no matter how many times I run my console application.
EDIT:
Here is my entire aplication if needed:
#include <...
Hello,
I have blocks of data associated with latitude/longitude values. I'd like to create a lookup key/hash value from the latitude/longitude value so it can be used as a lookup into a map or something similar.
I'm using negative values for West and South... therefore 5W, 10S is represented as -5, -10 in the program.
I'd like to...
This is a thought problem, and one I have been wrestling with for about a day.
I am writing an engine for a game in C (open source, for fun), and all of the interface (read GUI) elements deal with mouse input in a function interfaceMouse(). Basically, I call interfaceMouse() on a regular basis to see if the user has acted with the inter...
UPDATED: Is there a thread-safe, lock-free and available on all Linux distros increment function available in C or C++ ?
...
I'm using Dev C++ to write a simple C program and I need to create an image. I know how to use GD but unfortunately it's not included in Dev C++ installation.
Where can I download gd.h file? I'm using Windows Vista.
...
I'm writing a Unix application in C which uses multiple threads of control. I'm having a problem with the main function terminating before the thread it has spawned have a change to finish their work. How do I prevent this from happening. I suspect I need to use the pthread_join primitive, but I'm not sure how. Thanks!
...
Hi,
I'm currently learning C from some Harvard screencasts. They're great. I'm currently, because I'm used to it, using this process for running my code:
Type it it TextMate
Save it
gcc filname
run "./a.out"
goto 1
Is there a major process, program, or best practice I'm missing here? I've tried apple-R in TextMate, but to compile so...
I have three arrays (it's written in C but that is not important, it could be any language):
float x[] = {
0.72, 0.91, 0.46, 0.03, 0.12, 0.96, 0.79, 0.46, 0.66, 0.72, 0.35, -0.16,
-0.04, -0.11, 0.31, 0.00, -0.43, 0.57, -0.47, -0.72, -0.57, -0.25,
0.47, -0.12, -0.58, -0.48, -0.79, -0.42, -0.76, -0.77
};
flo...
It's all in the title; super-simple I reckon, but it's so hard to search for syntactical things like things anywhere.
These are two library files I'm copying from the web, and I'm wondering why they're called two different names
From here: CS50.net
...
Does anybody know of a good GDB (or other Linux debugger) tutorial for debugging multi-threaded C code? I'm looking for one that includes simple examples.
...
Hi, I'm stuck with this. I'm self studying assenbler and translating some basics instructions. But i can't with this one.
Can anyone help me, please?
int
secuencia ( int n, EXPRESION * * o )
{
int a, i;
for ( i = 0; i < n; i++ ){
a = evaluarExpresion( *o );
// Im trying to do this: o++;
__asm {
mov eax,dword ptr [...
When trying to compile the following code, I am getting a warning that line 18 makes integer from pointer without cast and that 19 and 20 are incompatible types in assignment. I am new to structures in C, and can't seem to figure out what is wrong.
#include <stdio.h>
struct song
{ char title[70];
};
struct playlist
{ stru...