Is there a reverse fn() for strstr
All, I am trying to find a similar function to 'strstr' that searches a substring starting from the end towards the beginning of the string. Thanks ...
All, I am trying to find a similar function to 'strstr' that searches a substring starting from the end towards the beginning of the string. Thanks ...
in C is: *(array) equivalent to array[0]? Therefore is *(array+2) equivalent to array[2]? ...
I am using Flex's Alchemy library to generate SWC's out of C files. I have a byte array (unsigned char buffer[size]) in the c-layer that I'd like to return to the ActionScript layer as a ByteArray. Do I have to iterate through the array and explicitly call AS3_Set on each element or is there a way to just return the entire C array at onc...
I'm looking for a C, C++ or Java based SOM implementation with licensing applicable for commercial use (non-zero cost is okay). So far I'm aware that there exists SOM_PAK (from Kohonen), but the licensing forbids commercial use. Is anyone aware of alternative implementations? ...
hey there could someone please help me determine the complexity?. An example given in my class was bubble sort int main() { int a[10] = {10,9,8,7,6,5,4,3,2,1}; int i,j,temp; for (j=0;j<10;j++) { for (i=0;i<9;i++) { if (a[i] > a[i+1]) { temp = a[i]; a[i] = a[i+1]; a[i+1] = te...
So im making a user space thread library. lets say theres some program that uses it. in that program it starts at the main method. before any calls to create_thread, there are no threads active. then when the first thread is created, the library makes 2 threads. One for 'main' and one for the actual new thead you are making. This is th...
How malloc call managed by user-library. I need the explanation of "How memory is being allocated in user space when malloc is called. Who manage it. Like sbrk() is called to enter in kernel space". ...
If I do: int j = ({int x = 7; x+3;}); In i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) gcc it compiles just fine. The block in question ({int x = 7; x+3;}) returns the value of the last statement as the value of the block. If you remove the parenthesis it doesn't compile. Can I expect this to work in most c comp...
Please tell me what will the call to given function return and how? The code: typedef struct { int size; ptrdiff_t index; void (*inlet) (); int argsize; ptrdiff_t argindex; } CilkProcInfo; /* * Returns a pointer to the slow version for a procedure * whose signature is p. */ /* the function definition is - */ st...
Hi I have a doubt regarding the backlog value in listen system call. From man page of listen system call. If the backlog argument is greater than the value in /proc/sys/net/core/somaxconn, then it is silently truncated to that value; the default value in this file is 128. It means my server can accept only <128 connections at once...
Take for example, The follow python code: def multiples_of_2(): i = 0 while True: i = i + 2 yield i How do we translate this into C code? Edit: I am looking to translate this python code into a similar generator in C, with next() function. What I am not looking for is how to create a function in C to output multiples of ...
I have a small ANSI C application which compiles cleanly under different tested compilers and platforms. It doesn't use any preprocessor switches or external dependencies and the makefile is simply something like: myapp: *.c gcc *.c -Wall -o myapp If I want to distribute this project in source form as portable as possible, should ...
In APUE section 8.3 fork function, about file sharing between parent and child processes, It said: It is important that the parent and the child share the same file offset. And in section 8.9 Race Conditions, there is a example: both parent and child write to a file which is opened before invoking fork function. The program contains a...
Hi! I am building an application (on windows using Dev-C++) and I want it to download a file. I am doing this using libcurl (I have already installed the source code using packman). I found a working example (http://siddhantahuja.wordpress.com/2009/04/12/how-to-download-a-file-from-a-url-and-save-onto-local-directory-in-c-using-libcurl/)...
I really have big problems with importing an extern C-Library to my existing C++-Project. I want to import libavcodec from the FFmpeg-Project, so I downloaded the latest source-code-release. What do I have to do now? Do I have to compile FFmpeg first or can I import it just like that? A really simple step-by-step manual would be awesome!...
Hi Community! I am currently programming a tool (in ANSI C) for my company which reads from an LDAP Directory and outputs all the data in a specific format (that is: the name format of our old proprietary directory db). This is then handled by another tool which reads the output and so on ... don't ask. Anyways, for my "ldaplist ..." c...
I got this chunk of code I can't really comprehend. I got stuck after it replaced pow2s's g to a map's gen structure. And from there, I can't see how it continues tracking the value, and how it is stored. The code compiles and runs. Can someone help me understand this code? Thanks! PS: I'm learning C It is translated from the follow...
I am trying to get a C# WPF application to communicate with another application written in C using WM_COPYDATA. The C app is trying to send a struct as follows: typedef struct { int x; int y; char str[40]; double d; char c; } DATASTRUCT; In my C# app I have defined a struct as follows: [StructLayout(LayoutKind.Seq...
I'm working on an NMDC client (p2p, DC++ and friends) with Qt. The protocol itself is pretty straightforward: $command parameters| Except for compression: "ZPipe works by sending a command $ZOn| to the client. After $ZOn a ZLib compressed stream containing commands will follow. This stream will end with an EOF that ZLib defines. ...
I have a wxPython which works perfectly on window xp theme but on switching to 'classic theme' rich text cntrl comes up without border. I can enable border for classic theme but for that Q1. I need to know if classic theme is enabled. Q2.I am also not sure how many different theme could be there which may break my app appearance. so w...