c

C error SQL pointer

my function take pointer *d as parameter. i write that line - EXEC SQL VAR d->x is STRING; Actually i want a variable which can store the value of d->x. with that variable i can manipulate some other work i got error Semantic error EXEC SQL VAR d->x is STRING; can anybody help. ...

Does EWOULDBLOCK work for sendto()?

Hi , Could someone please tell us if EWOULDBLOCK. works sendto()? If yes! please give an example ... thanks! If not, is there anything similar to accept error? Thanks for your replies ...

Getting error while debugging a C program in gdb mode

Hi, When I tried to run binary in gdb mode I am getting the below mentioned error message .Please find the error message in the attachment (gdb) r /devl/aaa/BINARY/pfm.sql_Kavitha /devl/aaa/AVP/OCT_TEST /devl/aaa/ASAPDATA/READONLY /devl/aaa/ASAPDATA/READONLY 17 kk12345 Starting program: /devl/aaa/BINARY/pfm.sql_Kavitha /devl/aaa/AVP/...

i want do convert a pcap file tu upddump file help required?

hello i have some network packets in pcap files , using ANSI c how can i change the pcap files to simple udpdumps ...

What are some good ways to do connection management in C?

In C, when making a networking client / server setup, I usually have to do some standard BSD socket setup. Then on the server side, I'll have to manage multiple threads, usually a main thread, an a io thread. Each connection is managed by a connection manager so that you can have connections being processed while new requests are coming ...

Is it a good practice to free memory via a pointer-to-const

There are many questions discussing the details of C and C++ dealing with pointer-to-const deletion, namely that free() does not accept them and that delete and delete[] do and that constness doesn't prevent object destruction. What I am interested on is whether you think it is a good practice to do so, not what the languages (C and C++...

Reuse of va_list

I need to do two (or more) passes over a va_list. I have a buffer of some size, and I want to write a formatted string with sprintf into it. If the formatted string doesn't fit in the allocated space I want to double the allocated space and repeat until it fits. (As a side-note, i would like be able to calculate the length of the format...

Effective ways to implement Every-to-Every interaction?

Given a list of elements, how to process all elements if every element requires knowledge about states of every other element of this list? For example, direct way to implement it in Python could be: S = [1,2,3,4] for e in S: for j in S: if e!=j: process_it(e,j) but it is very slow O(n²) if number of elements is huge. Th...

When implementing an infinite loop, is there a difference in using while(1) vs for(;;) vs goto (in C)?

When implementing an infinite loop, is there a difference in using while(1) vs for(;;) vs goto? Thanks, Chenz ...

How to retrieve data from a ListControl(ListView)?

Hi! I have a listcontrol with three columns. I want to read what text is in the third column. I need this, because i want color this column according to that what text is in it. Can anyone tell me, how to read the data? Thanks in advance! kampi ...

When to use system() and when to use execv*()?

I need to execute a unix command with different args in a loop. Now I wonder if I should use execvp(), passing in the cmd and the args, or use system, building a string consisting of cmd + args? ...

Carbon - OS X - Sending modified key events using CGEventPost

I'm trying to programmatically send modified keystrokes, for instance a capital "A". The problem is that the shift modifier does not seem to have any effect. In my code, I have two events, one for the shift key down, and another for the 'm' key down. CGEventRef mDown = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)46, true); CGEventRef ...

Array indexing starting at a number not 0 in c

Is it possible to start an array at an index not zero...I.E. you have an array a[35], of 35 elements, now I want to index at say starting 100, so the numbers would be a[100], a[101], ... a[134], is that possible? I'm attempting to generate a "memory map" for a board and I'll have one array called SRAM[10000] and another called BRAM[5000...

Directdraw: Rotate video stream

Problem http://stackoverflow.com/questions/2318390/windows-mobile-directdraw-rotate-video-stream The video preview is working, all I need now is a way to rotate the image. I think the only way to handle this is to write a custom filter based on CTransformFilter that will rotate the camera image for you. If you can help me to solve this...

how to pass array to stored procedure using OCI calls

When I try to pass an array of numbers to a stored procedure, the stored procedure is not able to get the array contents. Array.count = 0 in the stored procedure! The stored procedure is pretty simple. It just has to insert the parameters into a table. code looks like : TYPE arr_parmid IS TABLE OF testtable.UNID%TYPE INDEX BY BINARY_IN...

How to share a linked list between two processes?

I have two processes and i want to share a linked list between them. One of the processes is just going to read the list while other process is going to modify the list ( add/delete entries). Can you tell me how to achieve it? Let me add more details to it the language is C and the platform is Linux. It seems that shared memory is o...

Beginner extending C with Python (specifically Numpy)

I am working on a real time audio processing dynamically linked library where I have a 2 dimensional C array of floating point data which represents the audio buffer. One dimension is time (samples) and the other is channel. I would like to pass this to a python script as a numpy array for the DSP processing and then I would like to pass...

Need help with an Algorithm for non-contiguous Array. Index grouping

I'm need some help writing an algorithm in C/C++ (Although an language example would suffice). The purpose is a container/array, which allows insertion at any index. However if inserting an element in an index that is not close to an existing index i.e. would cause an large empty space of buckets. Then the array minimising the empty buc...

_DEBUG vs NDEBUG

Do you prefer #ifdef _DEBUG or #ifndef NDEBUG to specify debug sections of code? Is there a better way to do it? e.g. #define MY_DEBUG. I think _DEBUG is Visual Studio specific, is NDEBUG standard? ...

GCC style weak linking in Visual Studio?

GCC has the ability to make a symbol link weakly via __attribute__((weak)). I want to use the a weak symbol in a static library that users can override in their application. A GCC style weak symbol would let me do that, but I don't know if it can be done with visual studio. Does Visual Studio offer a similar feature? ...