Done! Quite simple actually... ty
void freeTree(Tree_str *Tree){
if(Tree){
freeTree(Tree->brother);
freeTree(Tree->son);
free(Tree);
}
Type: Posts; User: Tiago
Done! Quite simple actually... ty
void freeTree(Tree_str *Tree){
if(Tree){
freeTree(Tree->brother);
freeTree(Tree->son);
free(Tree);
}
I'm having a hard time trying to free an N-ary tree, don't know if this is asking too much, but can somebody please post a small and fast algorithm for that? or at least give me some guidelines...
...
I had already thought of that, just wanted to see if there was an alternative... I'll do it that way...
thank you both...
I believe it will spend too much time... is there any other way to get, for example, the penultimate character of a string faster?
The size of a string is static, unless we change it... what I mean by full is with all the spaces or almost all the spaces occupied by non '\0' chars ...
Hi,
Is it possible to find out if a chars string is full or half full?
I want to use realloc after a malloc, but only if the chars string is almost full...
TY
Ok, thank you... problem solved...
void OpenFiles(char *arg){
char *fpInName, *fpOutName;
fpInName = arg;
Hello...
I don't know why, but valgrind keeps giving me this error:
==2187== Conditional jump or move depends on uninitialised value(s)
==2187== at 0x40A550B: vfprintf...
Problem solved, never mind...
Hello everybody,
I've this structure:
typedef struct _Files_str {
char *fpInName, *fpOutName;
FILE *fpIn,*fpOut;
} Files_str;
Hi everybody...
The following code says that the bit field has a size of 4 bytes:
typedef struct BitField{
unsigned int A:1;
} BitField;
LOL, believe me, I'm not... Don't say that kind of things to me, some of the C gurus may feel insulted xD
I don't know what you have already learned or how much you want to learn about C, what I can say, from self experience, is that the way lo learn C is all about programming and programming again, and...
Ok, thank you all...
I've never been taught how to use bit operations and logic in C, but despite that (I'm going to have to learn it sooner or later), I'm going to spend some time trying to use...
actually I'm not :)
unsigned int type:4;
I'm not seeing how I'm going to change a single bit from the bit-word without adding too many logic to the program (I hate logic, even more if...
I've created a 4 bits Int... I want to change only one of the 4 bits of this Int, how do I do that?
ty...
After reading a file how do we manage to put the file pointer back to the beginning of the file?
ty...
The goal is to have a really fast program, memory is also a problem since this matrix (the game board) can have any size, the program will also use tons of memory and time trying to find a solution....
Hi, I'm supposed to make a program to solve a Board Game similar to a Chess Board. I want to store the information about pieces and their possible moves, during the game, in an integer matrix so each...
Hi...
Is there any difference between fprintf(stdout, "........") and printf("........")?
Which one is better?
They seem to do the same thing... I'm looking for a reason to use one and not...
can anybody help me with this function from g2 library?
further information at this link:
http://www.ib.cnea.gov.ar/~oop/g2/group__graphic.html#gdafb426bd26b996c0ef4bb6cb74e3b7f
i want to use...
How do I get rid of the rounding of "printf"?
I'm using float (% f) to read numbers from a file, and when I "printf" them they get rounded. They have only five decimal places.
TY
regards ;D
thanks for the replies...
Yes, you were right...
... afterall they all do the same... i'm going to use sprintf... seems fancier xD
I was wondering if there was a very good reason to use one...
Hi guys... and girls, if any... xD
Can someone tell me the main difference between strcpy and sprintf?
They are going to be used here:
typedef struct type_node{
char string[1024];
Hi,
How can i detect when Ctrl+anykey is pressed simultaneously???
My program should exit when I write "exit" or when Ctrl+D is pressed... I know that normally Ctrl+D should kill a program...