Hi
And again I ran into a problem where I cant find a straightforward solution...
I am doing some inline assembly and I wanna execute some code a few times by
using the .rept directive which tells the assembler to act as if the lines following .rept, up to the one just before .endr, are repeated the specified number of times.
The obvi...
Say I have a.so and b.so.
Can I produce c.so as a single shared library with all the functions exported by a and b, of course resolving all intra-dependencies (i.e. all functions of b.so called by a.so and the other way around)?
I tried
gcc -shared -Wl,soname,c.so -o c.so a.so b.so
but it doesn't work.
Same goes if I archive a.o and ...
Besides just the CDT what do you find essential for c development using eclipse?
...
The C standard allows pointers to different types to have different sizes, e.g. sizeof(char*) != sizeof(int*) is permitted. It does, however, require that if a pointer is converted to a void* and then back to its original type, it must compare as equal to its original value. Therefore, it follows logically that sizeof(void*) >= sizeof(...
I am writing a program, with a master thread and some worker threads, and I would like to get the signal handling right. My problem is the following :
Master thread starts and do all allocation
Master thread sets a SIGINT signal handler
Master threads start worker threads. worker threads don't need special cleanup, however they can b...
I am building a small shell interpreter which executes various commands, and I accomplish this by forking my process.
However, I want the child process to stop waiting for input in the standard input stream, and it does so by expecting an EOF. How do I push an EOF deliberately into that stream?
More specifically, if I am looping on thi...
I want to know a parameter which is an indicator of the current OS. If am supporting Windows and Linux, how can I get a system parameter which differentiates the OS types. This for an OS independent makefile which runs both in Windows and Linux by checking the parameter in an 'if'.
...
Here's my code:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <wait.h>
#include <readline/readline.h>
#define NUMPIPES 2
int main(int argc, char *argv[]) {
char *bBuffer, *sPtr, *aPtr = NULL, *pipeComms[NUMPIPES], *cmdArgs[10];
int fdPipe[2], pCount, aCount, i, status, lPids[NUMPIPES];
pid_t pid;
...
Hey!
I have a computer on a small network, so my ip is 192.168.2.100.
I am trying to get my real ip. I download the no-ip client but that just seems like a lot of trouble for such a simple thing.
I created this php script that got http://www.ip-adress.com/ page and retrieved the ip it gave me.
Is there a simpler way? Either using C, ...
Does someone know how can I use multi-dimesional arrays using C? Is that possible?
Thanks a lot...
...
I have a .dll that was provided, and I need to interface with it using java.
Do I have to rewrite the C to use the JNI types provided in jni.h? as seen in java sun's jni example.
Otherwise, How do i declare the native function my java function to pass and receive pointers?
thanks
...
Is there a toolkit/package that is available that I could use to find a list of wireless networks (SSID's) that are available in either Java, C#, or C for Windows XP+? Any sample code would be appreciated.
...
I just discovered a bug where the code looked something like this:
char *foo = malloc(SOME_NUM * sizeof(char));
if (!processReturnsTrueOrFalse(foo)) {
free(foo);
char *foo = malloc(SOME_NUM * sizeof(char));
// More stuff, whatever
}
This compiles, but it's weird that I am allowed to define two variables within the same fun...
On a 64-bit system, sizeof(unsigned long) depends on the data model implemented by the system, for example, it is 4 bytes on LLP64 (Windows), 8 bytes on LP64 (Linux, etc.). What's sizeof(size_t) supposed to be? Does it vary with data model like "long" does? If so, how?
[1] en.wikipedia.org/wiki/64-bit#64-bit_data_models
...
I just converted an Objective-C library to a C library in the hopes of making it cross platform. However, everything appears to do okay until I send this thing off to be processed.
It's at the point I get an error.
Looking back a few revisions, I noticed something in the debugger.
Right after a malloc'd string like so:
char *theStri...
What is the character encoding expected in libc? For example, gethostname(char *name, size_t namelen); takes char* as argument. Is it expected that the name parameter be encoded in utf8(which keeps the ascii intact) or plain ascii or some other format?
Also does C mandates any character encoding scheme?
...
Any idea about this error?
gcc -oxtmpmain.exe xtmpmain.o fiber_driver.o xtmp_options.o getopt.o D:\usr\xtensa\XtDevToolsDE\in
stall\tools\RB-2008.4-win32\XtensaTools\lib\iss\xtmp.lib
xtmpmain.o(.text+0x213):xtmpmain.c: undefined reference to `_uart_setup'
xtmpmain.o(.text+0x2da):xtmpmain.c: undefined reference to `_uart_cleanup'
coll...
I discovered a nice abstraction whereby I can read in data from UDP using a FILE. This works great for reading in data, but I cannot get it to work for spitting out data over UDP. Here is the code for reading in the UDP data over a FILE stream:
u_int8 *buf;
int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
struct sockaddr_in serverAddr;
if (...
I'm working my way through some C++ training. So far so good, but I need some help reinforcing some of the concepts I am learning. My question is how do I go about visualizing the byte patterns for objects I create. For example, how would I print out the byte pattern for structs, longs, ints etc?
I understand it in my head and can under...
Can anybody help me?
gcc -o uartsim.exe xtmpmain.o uartsim.o fiber_driver.o xtmp_options.o getopt.o D:\usr\xtensa\XtDevToolsDE\install\tools\RB-2008.4-win32\XtensaTools\lib\iss\xtmp.lib
gcc: xtmpmain.o: No such file or directory
make: *** [uartsim.exe] Error 1
...