Where can C debugger tutorials be found?
Is there any tutorial about using debuggers, when doing C programming on Linux (console mode)? ...
Is there any tutorial about using debuggers, when doing C programming on Linux (console mode)? ...
I'm trying to figure out how to execute machine code stored in memory. I have the following code: #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { FILE* f = fopen(argv[1], "rb"); fseek(f, 0, SEEK_END); unsigned int len = ftell(f); fseek(f, 0, SEEK_SET); char* bin = (char*)malloc(len); ...
Hi All, I am writing some binary data into a binary file through fwrite and once i am through with writing i am reading back the same data thorugh fread.While doing this i found that fwrite is taking less time to write whole data where as fread is taking more time to read all data. So, i just want to know is it fwrite always takes less t...
Hey people! Currently I'm working on a C/C++ cross-platform client/server software. I'm very experienced developer when it comes to low level socket development. The problem with Berkley sockets/Winsock, is that you always have to make some kind of parser to get things right on the receiver side. I mean, you have to interpret data, and ...
Hi, i want to generate a pseudo-random bool stream based on a modulo operation on another stream of integers (say X), so the operation would be return ( X % 2); The only problem is that X is a stream of integers that always ends in 1, so for instance would be somehing like 1211, 1221, 1231, 1241 .... is there a way for me to disregar...
Kindly tell me the function of matrix multiplication in GSL library. I have searched a lot but I am not be able to fine it. If any one know about that function kindly answer. Thanks in advance. ...
Imagine I have the header files to a subsystem, but no access to the source code. Now I want to generate stubs to match all functions declared in the header files (for testing purposes). I wrote some simple code to do this, but it's not perfect. Does anyone know of any freely available software which will do this? ...
Hello, I have a DLL written in C, which I must use. It is ok, but in one place I get an error. int getHourTime() { struct tm *psttm; time_t timet = //is initialzed correctly psttm = localtime(&timet); int nHour = psttm->tm_hour; return nHour; } I am calling it in C# using DLLImport. When getting to line: "psttm->t...
I just posted this as part of a reply to a question about the "best" bug-tracking software... Well, a tool on its own is just a tool. And while all speak of a toolchain, most just mean a loose collection of tools. Why not look for a problem tracker that "plays well with other children"? That is to say, interfaces well with your IDE, y...
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXLINE 1000 int getline(char *s, int lim) { int i = 0; while(i < lim - 1 && (*s = getchar()) != EOF && *s++ != '\n') i++; if(*s == '\n') *s++ = '\n', i++; *s = '\0'; return i; } int main(int argc, char *argv[]) { char line[MA...
I would like to monitor the use of mallocs and frees in an application by using the malloc and free hooks. Here's the documentation http://www.gnu.org/s/libc/manual/html_node/Hooks-for-Malloc.html From the example page you can see that my_malloc_hook transiently switches the malloc hook off (or to the previous hook in the chain) before...
I have a function which operates on piece of data (let's say, an int), and I want to change it in place by passing a reference to the valule. As such, I have the function: void myFunction(int *thing) { ... }. When I use it I call it thus: myFunction(&anInt). As my function is called frequently (but from many different places) I am conc...
I don't quite understand when people code in C, how they create their GUI interfaces. I've never seen a GUI implementation in C. I wondered if there is C libraries that allow you to create a GUI such as the one's we use daily in Windows or Linux? ...
I need to display all the ip addresses from my local computer, using C language. How this can be done? Thanks. ...
I want to create a process running under linux that creates multiple threads, each thread writing their own data out to a receiving process over a UDP socket connection. For sizing, say I need to have up to one hundred of these threads all running simultaneously with threads coming and going. Is it better to have each thread open up it'...
what's a fast way to roundup a unsigned int to a multiple of 4? a multiple of 4 has the two least significant bits 0, right? so i could mask them out and then do a switch statement, adding either 1,2 or 3 to the given uint. that's not a very elegant solution.. there's also the arithmetic roundup: myint==0?0:((myint+3)/4)*4 probably t...
Just saw this code: artist = (char*)malloc(0); and I was wondering why would one do this? ...
Can you cast a function pointer of this type: void (*one)(int a) to one of this type: void (*two)(int a, int b) and then safely invoke the pointed-to function with the additional arguments(s) it has been cast to take? I had thought such a thing was illegal, that both function types had to be compatible. (Meaning the same prototype-...
[user@host][~] 6> cc -xO4 timing.c -o timing [user@host][~] 6> ./timing Total run time: 0 [user@host][~] 6> Could someone tell me what this snippet of code does and where it is used? I am supposing from the command line. Aso, it seems like someone is testing a .c program for run time. But why is Total run time 0? Im not familiar with ...
Hello! I'm developing a little CGI application (in C, with CGIC, http://www.boutell.com/cgic/). My application needs to create a temporary file (the user upload an images, it is saved, modified in various ways, and then shown back to the user). What precautions should I take while creating temporary files? The modified image is provide...