Hi
I have a strange build problem.
I have a simple test program that sends a sigqueue to another process.
This little code example builds and runs when I build it as a c++ program (compiled with g++)
but when I compile it as a c program (with gcc) I get a error that he can't find the sigval struct.
The short example:
#include <std...
Hi All,
I have an issue regarding freeing memory as under:
string points; // some points sequences
char* charPoints = (char*)malloc((points.length() +1) * sizeof(char));
//do something
free(charPoints);
Even then after freeing memory is leaked when checked with instruments
...
Consider these definitions:
int x=5;
int y=-5;
unsigned int z=5;
How are they stored in memory? Can anybody explain the bit representation of these in memory?
Can int x=5 and int y=-5 have same bit representation in memory?
...
Suppose I have the following code:
main ()
{
char string[20];
printf(" The String is %s \n " , &str);
}
What would printf(" The String is %s \n " ,&str); give?
Suppose str points to location 200, what would &str give??
...
What packages do i need to install in order to use a Makefile. I've already installed cmake, would i need ocamlmakefile?
My problem is that whenever i type 'make' into the terminal, i'm told "make command not found".
...
Hi, I wish to use "C" legacy project in the Eclipse. In the project it require "autoreconf
-vi" followed by "./configure" before make to start. My problem is I am not able to do "autoreconf -vi" and "./configure" from the eclipse.
Thanks
Arpit
...
hi,
I have a set of *.C files(embedded related). Could anyone please detail to me the steps/processes(internal information) involved while compiling followed by linking to create the final executable(I need the information/steps regarding what a preprocessor/compiler generally performs to a C src code)
Also i just want to get an idea ...
What do modern companies use to compile and link their projects?
Especially with large projects, makefiles don't seem usable enough to be scalable. As far as I can tell, many companies use either in-house build systems or in-house scripts on top of existing build systems.
Do large projects use make?
Is pure Ant, Maven, etc used or is...
For example printf instead of cout, scanf instead of cin, using #define macros, etc?
...
for(int i=0 ; i++ ; printf("%d",i));
printf("%d",i);
O/P is 1 .
If we take i=1 then there is an absurd output and if i=-1 then output is 01.
How is the For loop functioning.Plz Help.Thanx.
...
Hi,
I've got a general question about the recv-function of winsock.
I write a programm with a client/server-architecture where the client sends a camera image to the server and the server sends another image back to the client.
The client sends serveral images until the program is closed. And the server will responds every received imag...
I have recently developed a habit of running all of my programs through valgrind to check for memory leaks, but most of its results have been a bit cryptic for me.
For my latest run, valgrind -v gave me:
All heap blocks were freed -- no leaks are possible
That means my program's covered for memory leaks, right?
So what does this err...
hello, im doing a project and this part is rly important to me.i'll try to be as clear as possible.
suppose we have an mxn matrix with all 0s, i need to generate all possible combinations of the array in which only one element in a row is initialised to 1 and all the other elements in that row are 0s. similarly, in all the rows, exactly...
Hi
I'm studying for my test in C and I'm reading in a C summary I downloaded from some site.
It is written that it is not allowed to write arr[i] where i is a variable. The only way to do it is with malloc.
However, I wrote the following code and it compiles without warnings and without error on valgrind:
int index = 5;
int a4[...
I'm trying to figure out some C code so that I can port it into python. The code is for reading a proprietary binary data file format. It has been straightforward thus far -- it's mainly been structs and I have been using the struct library to ask for particular ctypes from the file. However, I just came up on this bit of code and I'm at...
I'm trying to learn about C pointers but I cannot understand somethings...
The following code:
#include <stdio.h>
void foo(int *x, int *y);
void foo(int *x, int *y) {
printf("x = %p\ny = %p\n", &x, &y);
*x = 5;
*y = 6;
}
int main(void) {
int a, b;
printf("a = %p\nb = %p\n", &a, &b);
foo(&a, &b);
return 0;
...
I have written a small program that tests the ALSA library on an Embedded Linux board. The program configures ALSA, plays a single sound and then waits 1 minute before exiting.
Here is what I am observing: after playing the sound, there is silent pause and then the sound is played again. I am 100% positive that the program itself is not...
The task is to implement a bit count logic using only bitwise operators. I got it working fine, but am wondering if someone can suggest a more elegant approach.
Only Bitwise ops are allowed. No "if", "for" etc
int x = 4;
printf("%d\n", x & 0x1);
printf("%d\n", (x >> 1) & 0x1);
printf("%d\n", (x >> 2) & 0x1);
printf("%d\n", (x >> 3) &...
Hi guys, I'm taking a class on C, and running into a segmentation fault. From what I understand, seg faults are supposed to occur when you're accessing memory that hasn't been allocated, or otherwise outside the bounds. 'Course all I'm trying to do is initialize an array (though rather large at that)
Am I simply misunderstanding how to ...
#include <stdio.h>
#include <stdlib.h>
void foo(int *a, int *b);
void foo(int *a, int *b) {
*a = 5;
*b = 6;
a = b;
}
int main(void) {
int a, b;
foo(&a, &b);
printf("%d, %d", a, b);
return 0;
}
Why a = b (foo) doesn't work? printf outputs "5, 6"
Thank you.
...