I have some code to interface Python to C++ which works fine but every time I look at it I think there must be a better way to do it. On the C++ side there is a 'variant' type that can deal with a fixed range of basic types - int, real, string, vector of variants, etc. I have some code using the Python API to convert from the equivalen...
static void deinterleave_pad_added_cb(GstElement * deinterleave, GstPad * pad, AudioDeintBin * dat)
{
_AxonDVR * dvr;
gchar * name;
GstElement * bin;
g_return_if_fail(dat != NULL);
dvr = dat->dvr;
name = gst_pad_get_name(pad);
DEBUG("Got '%s' pad", name);
/* Left/Right Channels */
if(g_...
what happens when you use negative operators with %.
example -3%2 or 3%-2
...
Hello everyone.
I am in a kind of an weird condition in my code. I am writing an Apache module that needs to add a comment in the head tag of the response document (apart from doing some other unimportant stuff).
At the point where I need to parse the response document, I have the whole document in memory in the form of a char * buffer...
"whether a field may overlap a word bounday is implementation - defined.fields need not be named; unnamed fields ( a colon and width only) are used for padding. the special width 0 may be used to force alignment at the next word boundary."
i m unable to get these lines...please explain...
...
How can I reference a class/framework/library like libusb in an Objective-C class?
Currently I have tried to initiate an enum/struct-function from the library inside my @interface in my .h-file.
But that doesn't work, apparently. :/
I have it "installed" (it's in /usr/local), and tried adding both the files and as framework. Doesn't hel...
K&R says:
by default external variables and functions have the property that all references to them by the same name, even from functions compiled separately, are references to same thing
Please explain what this means, I don't understand it
...
Is there any particular reason that multi-line string literals such as the following are not permitted in C++?
string script =
"
Some
Formatted
String Literal
";
I know that multi-line string literals may be created by putting a backslash before each newline.
I am writing a programming language (similar to C) and would like ...
I am writing a program which searches through all the sub-directories of a given directory. The problem is, is that I know the name of the file that I am looking for (data.txt) but I still need to know all of the (possibly multiple) locations where the file is. I am using this code to search:
struct dirent *dp;
struct stat s;
DIR *dir;
...
Hi all, let's say I've
foo.c
struct foo {
int a;
};
bar.c
struct foo {
char *s;
double x,y;
};
The struct definitions are only in .c files. Is it legal according to C standard? Which part of standard says so?
Edit: There're no #inclusion of struct definition.
Thank you all for fast response! :D
...
The dimensions are unknown at compile time, so I'm trying to allocate a 2D array of structs dynamically. The code compiles but I get a bad access when accessing an element.
// The struct
typedef struct
{
NSInteger numActors;
Actor *a1;
Actor *a2;
Actor *a3;
Actor *a4;
Actor *a5;
} GridNode;
// In interface
GridN...
Hi,
Declared one structure STRUCT_ABC in a header file abc.h
Included abc.h in abc.c file and used STRUCT_ABC in some function inside abc.c.
Another file def.c does not include abc.h. But in def.c, i again defined a structure with same name, i.e. STRUCT_ABC, but with different contents.
Both abc.c & def.c are under same library and con...
How can I get Visual Studio to help me optimize my application, or tell me areas of slowness? Thanks
...
Are these 2 methods equivalent ?
char a[10] = "";
char a[10] = { 0 };
Also, I would like to declare-initialize a struct but this will not work in gcc:
struct c
{
char d[10];
int e;
};
struct c f = { 0 };
a.c: In function ‘main’:
a.c:33: warning: missing braces around initializer
a.c:33: warning: (near initialization for ‘f...
I'm working on Project Euler #14 in C and have figured out the basic algorithm; however, it runs insufferably slow for large numbers, e.g. 2,000,000 as wanted; I presume because it has to generate the sequence over and over again, even though there should be a way to store known sequences (e.g., once we get to a 16, we know from previous...
In visual basic I have the following 2 strings:
"\\.\" & "\"
How do I represent them in C?
Also, & in VB is the concatenation operator?
...
Possible Duplicate:
Could anyone explain these undefined behaviors (i = i++ + ++i , i = i++, etc)
I am wondering if x[i] = --i is defined by C standard.
I tested it with g++ and it looked like x[i] was resolved before i was decreased. Is this a standard? And can you give me some more information about how is this evaluated.
...
Hi Guys,
I need to deal with a counter that gives me ticks for my application. The counter is 32bits so what i need to know is how to deal with it when it wraps. for example:
I have a function that returns a (timestamp + shifttime) and i have another function that will return 1 or 0 depending whether or not the time has elapsed, but t...
I read from a book about tentative defination that,
"A tentative definition is any external data declaration that has no storage class specifier and no initializer. A tentative definition becomes a full definition if the end of the translation unit is reached and no definition has appeared with an initializer for the identifier"
Please ...
Program received signal SIGSEGV, Segmentation fault.
0x08049795 in execute_jobs ()
Current language: auto; currently asm
(gdb) info symbol 0x08049795
execute_jobs + 22 in section .text
(gdb) ptype 0x08049795
type = int
How to get the line number at which the error occurred?
...