I've got two different Python extension modules; let's call them A and B. Module A contains a storage class type called container that I want to use within Module B as the return type of a class method.
I can't seem to find any documentation on how I'm supposed to do this. I roughly followed this article to create the modules/classe...
Hi all,
I've written a simple library file with a function for reading lines from a file of any size. The function is called by passing in a stack-allocated buffer and size, but if the line is too big, a special heap-allocated buffer is initialized and used to pass back a larger line.
This heap-allocated buffer is function-scoped and d...
Hi,
In my c/c++ files, there are multiple #define. As an example:
#ifdef LIBVNCSERVER_HAVE_LIBZ
/* some code */
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
/* some more code */
Can you please tell me how can I modify my Makefile.in so that I have those #define in ALL files during compilation?
Thank you.
...
How can you count the number of characters or numbers in each line? Is there something like a EOF thats more like a End of Line?
...
I know this is really general, but I get "this" (see below) when I run my .c file in Visual C++ 2008 Express. It happens when I call malloc (). Take my work on this - I dynamically allocate memory properly.
HEAP[Code.exe]: HEAP: Free Heap block 211a10 modified at 211af8 after it was freed
Windows has triggered a breakpoint in Code...
I'm working on a project and I came to a point where the following stack trace popped up:
#0 0x0017c30c in _IO_flush_all_lockp () from /lib/libc.so.6
#1 0x0017d030 in _IO_cleanup () from /lib/libc.so.6
#2 0x0013e042 in exit () from /lib/libc.so.6
#3 0x00126bbe in __libc_start_main () from /lib/libc.so.6
#4 0x08049d11 in _start ()
...
How can I print a non-null-terminated string using printf, assuming that I know the length of the string at runtime?
...
I'm currently working with a SPC that supports ANSI C, but uses its own flavour of the GNU compiler, which doesn't compile any variadic functions and things like itoa. So using sprintf & co. isn't an option for converting integers to strings. Can anyone guide me to a site where a robust, sprintf- free implementation of itoa is listed or ...
Hello,
gcc 4.4.2 c89
I have a file called main.c.
I want the result of the pre-comiler and save it to a text file.
I have done the following which creates a text file, but there is nothing in it. It is zero bytes.
gcc -E main.c | > main.txt
Many thanks for any suggestions,
...
Sample eg:
messageStruct.hpp
class MessageStructure_t{
public:
struct MsgData_t {
float a;
int i;
}__attribute__((packed))msgdata_m;
};//classs end
I have a file in my project Application.c. I need to access the structure variables here.
Both are different, one .hpp and the other .c
How can I do this ?
Hoping your kind ...
how will you add numbers like 1234567890123456789012345678901234567890, which can't be specified using primitive data types? what kind of data structure will you use ?
...
can anyone help me on how can i create a pdf file using turbo c? (e.g typing something and save it as .pdf)
...
Possible Duplicate:
What is the arrow operator (->) synonym for in C++?
I couldn't find documentation on the "->" which is used a lot in Gnome codebase. For example in gedit they have this:
loader->document = g_value_get_object (value)
What is document in relation to loader? There are many other examples as well with more bas...
Say I have this struct:
struct MyStruct {
int iID;
int iMyNumber;
};
Then I define an array of MyStructs:
struct MyStruct msTest[3];
I'm doing a sorting operation on a struct similar to this one by looking at the ID. Now, as soon as I find out which records should be swapped to sort the array I have to do the actual swapping. I...
Is there a waymuch like viewing the result of preprocessing with gcc -Eto see what my objects look like once compiled into object files?
I am talking about GCC, but a solution including MSVC would be fine.
...
Neither of these snippets of code work:
int main() {
struct mystruct {
int a;
char* b;
char* c;
} e,f;
e = {5, "blaat", "boe"};
return 0;
}
Error: syntax error for '{' token
int main() {
struct mystruct {
int a;
char* b;
char* c;
} e,f;
struct mystruct e...
I'm using a header called colors.h to organize my source code. The header is like this:
#define DEFAULT 0x07
#define BLACK 0
#define GRAY 7
#define BLUE 9
#define GREEN 10
#define CYAN 11
#define RED 12
#define MAGENTA 13
#define YELLOW 14
I'm putting the header at the same directory of the main source code, called kernel.c, and inclu...
Hello all,
I'm working on an application that I'm going to write with C and i am considering to use a nosql db for storing timeseries data with at most 8 or 9 fields. But in every 5 minutes there will huge write operations such as 2-10 million rows and then there will be reads(but performance is not as crucial in read as in the write op...
I have a function to print characters on the screen that is like this:
void print(int colour, int y, int x, const char *string)
{
volatile char *video=(volatile char*)0xB8000 + y*160 + x*2;
while(*string != 0)
{
*video=*string;
string++;
video++;
*video=colour;
video++;
}
}
And I want to prin...
Possible Duplicates:
What is Type-safe?
What is type-safety?
I was reading about c++ vectors and it was mentioned that memcpy and printf functions from C are not type safe. Article here: http://en.wikipedia.org/wiki/Vector_(C%2B%2B).
Question: In simple English, what is type safety and what are the "type safe" alternatives?
...