c

Address problem !

consider this : [mdstest:~/onkar/test]$cat test.c #include<stdio.h> int main(int argc,char **argv) { printf("%p\n",main); return 0; } [mdstest:~/onkar/test]$make gcc -g -Wall -o test test.c [mdstest:~/onkar/test]$./test 0x8048368 ------------------------------------- (1) [mdstest:~/onkar/test]$gdb test ::::::::::: :::...

what object type does self.parent in obj-c return?

just curious to know if it would return (id) or (parent class) or something else. ...

How can I pass a multidimensional array to a function ?

How can I pass a multidimensional array to a function in C/C++ ? The dimensions of array are not known at compile time ...

GDB - What is the mysterious Assembly code ?

Dump of assembler code for function main: 0x0804833e <+0>: push %ebp 0x0804833f <+1>: mov %esp,%ebp 0x08048341 <+3>: sub $0x8,%esp 0x08048344 <+6>: and $0xfffffff0,%esp 0x08048347 <+9>: mov $0x0,%eax 0x0804834c <+14>: add $0xf,%eax 0x0804834f <+17>: add $0xf,%eax 0x080...

mempcy fail to copy all data

Hello all, I encounter problem with memcpy in C. Here is the code : typedef struct { CPY_IM009_DEF }message; message msg; with CPY_IM009_DEF is a struct in other files. Then I try this char wx_msg_buf[8192]; memset(wx_msg_buf, 32, sizeof (wx_msg_buf)); memcpy(wx_msg_buf, &msg, sizeof (msg)); when I check the size : sizeof (msg)...

Which file should I pass as pathname argument of ftok()

It is mentioned in ftok() manual key_t ftok(const char *pathname, int proj_id); The ftok() function uses the identity of the file named by the given pathname (which must refer to an existing, accessible file) ... I am confused about const char *pathname. What would be the best practice for it? On my current system I can pass "...

Equivalent asm code for C/C++ codes

Possible Duplicate: How do you get assembler output from C/C++ source in gcc? Hello out there! I have a C and C++ source code that I wanted to see in assembly code. How can I produce an equivalent asm codes for those? What tools should I use? Or is it already possible in using tools such as the gcc compiler? Then what command...

family of binary hash functions

Hi, I am looking for a family of hash function F1,..Fn, where each Fi maps any key in [0,1]. My first implementation was Fi(k) = F(k,i) = hash(i,hash(k,0)),. Here hash is the hashlittle function provided here (http://burtleburtle.net/bob/c/lookup3.c). I haven't looked under the hood of what exactly hashlittle does. As sharp readers wou...

Garbage collection libraries

Are there any "good" C libraries for garbage collection? I know about the Boehm GC, is it maintained nowadays? What about http://tinygc.sourceforge.net? What are your experiences with these libraries? ...

Is there a way to free only a part of the dynamically allocated array in C\C++ (shrink existing array)?

In a program I allocate a huge multidimensional array, do some number-crunching, then only the first part of that array is of further interest and I'd like to free just a part of the array and continue to work with the data in the first part. I tried using realloc, but I am not sure whether this is the correct way, given I must preserve ...

Good IMAP library for a Mac application.

I am looking for a nice library that can talk to GMail from a Mac application. Really, I am thinking about writing a GMail application for the Mac. Thunderbird and Mail.app just don't cut it for me. Anyway, the library should be written in C, C++ or Obj-C or at least have interfaces for those languages. Of course, anything free and/or o...

string concatenation with strncat leads to error in signedness

update: the point of whether char, signed char, or unsigned was ultimately moot here. it was more appropriate to use memcpy in this situation, since it works indiscriminately on bytes. Couldn't be a simpler operation, but I seem to be missing a critical step. In the following code, I am attempting to fill bufferdata with buffer for wh...

Printing '%' with printf in C/C++

Possible Duplicate: How to escape the % sign in Cs printf? This has to be an easy question but I can't find the answer on my book or the web; how to print '%' in C ? e.g.: printf("A: %.2f%", pc); ...fails, the compiler complains there is an invalid conversion. Of course an easy way is; printf("A: %.2f%c", pc, '%'); But ...

How to write logfile in C

i want to write logfile in c programm, but after day musst be add newlogfile with tempstamp have you idea, or there is libary!!! ...

standard structure for C header and source files

Is there any standardized structure of C source and header files? I'm thinking about something like this (example for C source file): // static variables // public variables // static methods // public methods ...

why dont we use (void) in main?

people use void main() /*empty braces()*/ but have been tought to write void main(void) any ideas about the diffrence? ...

Most simple and fast method for audio activity detection?

Given is an array of 320 elements (int16), which represent an audio signal (16-bit LPCM) of 20 ms duration. I am looking for a most simple and very fast method which should decide whether this array contains active audio (like speech or music), but not noise or silence. I don't need a very high quality of the decision, but it must be v...

SQLite: Inserting a C struct into multiple tables - help with design.

Hi all Here's a short program that creates a SQLite database to hold some basic music metadata. There are three tables in the database for three fields of metadata; song title, the album the song comes from and the artist who made the album. Due to the nature of the data, duplicated information in metadata is a certainty (as demonstrate...

Why would I want to start a thread "suspended"?

The Windows and Solaris thread APIs both allow a thread to be created in a "suspended" state. The thread only actually starts when it is later "resumed". I'm used to POSIX threads which don't have this concept, and I'm struggling to understand the motivation for it. Can anyone suggest why it would be useful to create a "suspended" thread...

Error while using libsoup

Hi, I am writing a client using libsoup APIs. I have done the following. `session = soup_session_sync_new(); msg = soup_message_new("GET","http://www.google.com"); status = soup_session_send_message(session,msg);` However now i am getting the following error code in status. I print the reason phrase and it says the status= 4 , msg-...