I have a makefile which has statements like below:
TOPICS = dmic
SRV_MODE =
ifeq "$(SRV_FLAG)" "ON"
SRV_MODE = 2
endif
vpath d%_srv.h $(CNT_PATH)
USER_PRE_TARGETS := $(foreach topic,$(TOPICS),$(topic)_srv.h)
dmic_srcs = $(wildcard $(CCWSCA)/dmic/src/*.c) \
$(wildcard $(CCWSCA)/dmic/src/*.ppc)
dmic_srv.h: $(dm...
This is in C.
I have two 2D arrays, ArrayA and ArrayB, that sample the same space. B samples a different attribute than ArrayA less frequently than ArrayA, so it is smaller than A.
Just to try to define some variables:
ArrayA: SizeAX by SizeAY, indexed by indexA for a position posAX, posAY
ArrayB: SizeBX by SizeAY, indexed by indexB...
Possible Duplicate:
Why is i = ++i + 1 unspecified behavior?
Consider the following snippet :
int i=10;
printf("%d %d %d",i,++i,i--);
The order in which the arguments to a function are evaluated is unspecified in C/C++.So it lead to unspecified behavior.
Am I correct or missing something ? Please Explain.
EDIT:Well,some me...
I'm trying to avoid TIME_WAIT in a client. I connect and then set O_NONBLOCK and SO_REUSEADDR. I call read until it returns 0. When read returns 0, the errno is also 0. I interpreted this as a sign that the server closed the connection. However, if I call close, the socket is set to TIME_WAIT, as confirmed by netstat.
Since I make ...
Hello,
I am programming in Objective-C but I would like to write a c function to increase the performance. I have written the code below this post but the compile keeps coming back with the following error:
error: expected specific-qualifier-list before 'bool'
error: expected '=', ',', ';', 'asm' or 'attribute' before 'addToBo...
I am having trouble understanding what it means to add a descriptor to writefds set for select() in linux. I wrote some simple code that adds the descriptor for stdout to the writefds set and uses a timeout of NULL. Now, my code just infinite loops checking if this descriptor is set, and if it does, it prints "WRITING". When I run my cod...
I am learning about strings in C now.
How come to use scanf to get a string you can do
scanf("%s",str1);
and for printf you can do
printf("The string is %s\n", str1);
I understand that for scanf it is because the string is just a character array which is a pointer, but for printf, how is it that you can just put the variable name...
What the best way to map XML schemas to C/C++?
Here is an example:
------ C/C++ -----
struct zone {
char *var_name;
float var_value;
};
------ XML -----
<xs:element name="zone">
<xs:complexType>
<xs:sequence>
<xs:element name="Var_name" type="xs:string"/>
<xs:element name=...
What is the most efficient way to generate a signed float array of arbitrary length containing the amplitude (represented from 1 to -1) of a sine wave in C?
...
Hi
Could someone please help and tell me if there is a possibility to pass an xml schema through a socket program written in C/C++ ? here is an example:
---- c/C++ ----
...
struct zone { // as an example
char *Var_name="xxx";
float var_value = 1.3;
};
----- xml ---
...
<xs:element name="zone">
<xs:complexType>
<xs:sequence>...
Hi all ,
Is there any body who can tell how to create symbol table for compiler using C.
...
I'm planning to code a library that should be usable by a large number of people in on a wide spectrum of platforms. What do I have to consider to design it right? To make this questions more specific, there are four "subquestions" at the end.
Choice of language
Considering all the known requirements and details, I concluded that a lib...
I have a structure called table, I just want to create a table, like constructor in java, but when i call this function in main, it gives segmentation fault
struct table *create(char *name,int number,char *s_name)
{
struct table *newTable;
newTable->name = name;
newTable->number = number;
newTable->s_name = s_name;
return newT...
Hi all I was wondering how (if possible) to change to an external HDD in C. I am writing a program that works with an external HDD.
Thanks much,
Mr. Man
...
I am maintaining a small application that has some plugin-like functionality, which is implemented through runtime-loaded dynamic modules.
Specifically, since it's a Gtk+ app, I'm using gmodule, but the question applies to dlfcn.h / dlopen() based dynamic library loading just as well.
My main program has a single, global struct variab...
I am trying to write server that will communicate with any standard client that can make socket connections (e.g. telnet client)
It started out as an echo server, which of course did not need to worry about network byte ordering.
I am familiar with ntohs, ntohl, htons, htonl functions. These would be great by themselves if I were trans...
Is there some way to make boost::python control the Python GIL for every interaction with python?
I am writing a project with boost::python. I am trying to write a C++ wrapper for an external library, and control the C++ library with python scripts. I cannot change the external library, only my wrapper program. (I am writing a functi...
Is there any advantage in doing bitwise operations on word boundaries? Any CPU or memory optimization in doing so?
Actual problem:
I am trying to create XOR of two structure. Lets say structure-1 and structure-2 both of same size 10000 bytes. I leave first few hundreds bytes as it is and then start XOR of 1 and 2.
Lets say I start with...
Could someone please explain the differences between POSIX sockets and BSD sockets?
...
Hi,
I have this homework assignment:
Let Pi be the element of arr in index i. We say an index i is ‘well-placed’ if there exists an index j (j >= i) so that summing the elements in Pi Pi+1 … Pj yields the index i. In other words, an index is ‘well-placed’ if a sequence of elements beginning at that index yields the index when summed....