I am asking this because I never paid attention to this paramter. But recently I saw that a developer in my team changed memset call in a legacy code that I am working from:
memset(buff, 0xFF,...
Type: Posts; User: Mortissus
I am asking this because I never paid attention to this paramter. But recently I saw that a developer in my team changed memset call in a legacy code that I am working from:
memset(buff, 0xFF,...
According to link, memset accepts an int for the value to be set. Why an int, if memset set each byte in the buffer?
I can only imagine that memcpy tries to optimize by copying 4 bytes at a time....
I tried to create a code snippet using difftime, but it didn't work. First I had to subtract 70 from the resulting years, since gmtime starts from 00:00:00 on January 1, 1970. But the struct tm...
Thanks! I will start my reading right away!
Any good reading of the state of the art (kernel 2.6) on this subject?
I would like to know a little more about the details.
Thanks ;D
So obvious... I am a little rusted.
Thanks ;D
Why?
What is the difference between them? The only thing I spot is the foo() being called inside do_foo(), which we agreed is an error.
You must see a file as a storage of bytes. You can read and write anything from/into it. You could write an integer, for example, in this case, the file is binary.
It was a short answer, because...
Isn't because do_foo call foo that calls do_foo again (and so forever)??? ;)
Did you run this code?
It worked!!!
Thanks.
Thanks so much, I will try it right now. I have searched for many days for a solution, but I didn't search in the most obvious place: the Oracle manual (I feel so amateur). You have saved me many...
Is there a way to use Oracle cursors with ODBC? I must access an Oracle Database and use its stored procedure, that returns the result in a cursor. I don't know any type in ODBC that matches an...
The >> is text oriented, i.e., it reads until it finds a space or a newline character. Look for the read function, it might be handy.
Hi, I have made a test myself and would like to share the results:
// test.cpp
#include <pthread.h>
#include <stdio.h>
#include "my_lib.h"
int main()
Hello! I have a couple of functions that MUST share a single variable. These functions will be compiled into a dynamic library (.so) and this library will be accessed by multiple threads. Is this...
Thanks so much! :D
Is there a way to "overload" the symbols of a binary? For example, I compiled my application and sent it to user. He is running it, but he discovers that the application randomly crashes. I suspect...
Well, if you need to impose a specific option order, it doesn't make much sense to use options. I believe that the idea behind the options is the possibility to specify them (or not) in any order.
¬¬
You can solve this problem with simple programming. Create variables for each information you need to write. Perform the while-switch to read the options and assign the options to the...
Thanks for the reply :)
The problem isn't have the id inside each structure. The problem is that I want a generic pack function (void* parameter), but I want to be able to discover in the receiver,...
Google: man getopt_long
int getopt(int argc, char * const argv[], const char *optstring);
It works on Linux and gcc on Windows.
Edit: I am pasting an example from the man page itself:
#include <stdio.h> /*...
Hi, I need to send different structures through the network, and be able to recover them at the other side. I do not know how to give each structure an unique identifier, so I can discover what is...
Yes.