Ok :)
Anyway, I was curious and I checked about that macro with this source code:
#include <stdio.h>
int main(void){
#ifdef _BSD_SOURCE
printf("_BSD_SOURCE is defined\n");
Type: Posts; User: kr0n1x
Ok :)
Anyway, I was curious and I checked about that macro with this source code:
#include <stdio.h>
int main(void){
#ifdef _BSD_SOURCE
printf("_BSD_SOURCE is defined\n");
Thanks for your support, grumpy.
I was reading 'man signal' to learn more about this behaviour, and it seems to change according to libc version and macros defined.
In my Ubuntu 10.04...
I'm reading the GNU libc manual, the part about signals.
In this page it shows some code. I report it here:
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
...
A lot of the recursive functions I've been using have returns (for example those with trees and lists management). Since I was not able to make it with returns (in this exercise), I was curious to...
Hi, the exercise is this:
I got two sorted arrays (of any length) and I got to merge them into a new array (of correct length, and still sorted), recursively.
I solved the problem like this:
...
I found a way to implement it with a queue.
I should make the code better (at least the level_insert() function), but I'll post it anyway just for someone who could need it.
Tree level insert...
@iMalc: That's how I wanted the tree to look like, sorry if i wasn't clear in the first post.
That algorithm is awesome :D
Is the queue implementation possible/useful/easier? Which would you...
I don't care to keep the tree balanced, I only need to fill a tree by using a struct like this:
struct node {
int data;
struct node *left;
struct node *right;
};
I've seen some...
Hi, I would like to learn an algorithm to create a balanced tree.
I don't mean a Binary Search Tree (lowerThanRoot values go to left, HigherThanRoot go to right), I just want the tree to fill...
Oh... at the university my professors taught me wrong.
I didn't know that it contained malloc too... I'm reading on wikipedia right now.
Yay I got it :D
#include malloc.h
then, right before the strncpy instruction, I put:
result = malloc(i2);
Now it seems to work :) thanks! I will complete it for multiple files.
...
Ehm... what's wrong with that "result = strncpy(result, *ppc, i2);" ? In that part i want it to point to the "first part" of the filename, the part which is before the (copy) string (which I add it...
Hi, I'd like to make a program which does this renaming work:
example.txt -> example(copy).txt
Also, I'd like it to support any number of '.' into the file name, like:
example.2011.txt ->...