yeah, I fixed that earlier.
About the len variable, I need to know the size of the array so that I print the correct string. I did a check and it turns out len is always 1. How do I get the size of...
Type: Posts; User: Leojeen
yeah, I fixed that earlier.
About the len variable, I need to know the size of the array so that I print the correct string. I did a check and it turns out len is always 1. How do I get the size of...
Haha, no it doesn't. I don't how it ended up there.
Hello!
I'm supposed to write a program forks 3 processes (4 in total, including the father). and then have each process fork three threads and two additional process. These two additional processes...
Ok, it works now after I cast the sqrt in the printf to int.
Yes, I saw that. We focused on developing the equation of house versus max in earlier posts, I thought EVOEx was talking about the that temp variable. I didn't consider the last part of the code....
Ok, I appreciate your help. I don't think repeating the same exact answer is that encouraging but I'll keep working on it. Maybe others will join.
I used unsigned long long everywhere. I don't see...
Yes, my mistake.
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdint.h>
int isPerfectSquare(unsigned long long );
int main(int argc, char* argv[]){
int...
Ok, after doing some math, I made it efficient a little bit in terms of time. But still, the program fails to give me right answers after the 6th line. I think the unsigned long long is not enough. ...
Anyone?
I have two loops because I need to keep track of how many lines to print, otherwise the program will crash.
Your formula doesn't reduce the number of loops in this case. It simplifies the...
Yes, I copied it right from my Dev C++ opened file. Can you give me some hints of your mathematical work so I can do some research later on?
You mean something like this!
#include <stdlib.h>...
Ok. This is giving me a headache. I used long long everywhere when I deemed necessary.
Now I get 0s for the max value. Very strange.
#include <stdlib.h>
#include <stdio.h>
int main(int argc,...
Yes, thank you.
Such a solution is lovely, but I'm just trying to solve the problem for my self. So it's really important for me to know what went wrong in my code. Later on, I'll think on doing...
I tried what you said tabstop. Still, no output after the 6th line. I undersand the problem with int, but long long didn't fix it.
Ok. I did as told. I changed temp type to long long but I still get the same output as above!
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[]){
long long...
Already tried. The problem still takes a long time to execute the 6th line of input. I've waited a little bit, and it gave me strange results:
6 8
35 49
204 288
1189 1681
6930 ...
Hello there!
The following is an implementation of the street numbers problem.
My output stops at the fifth line! probably because of bad memory management or the size of the integers. I tried...
Nahla right?
You read many books you said, and yet you can't program a typical data structure in C, I just finished my data structures course as well, and I'm sure linked list implementation is...
Seems like you're trying to implement a Fibonacci sequence!
Anyway, that does "i+2" mean? If you want to increment i by 2 the way to do it is
i = i + 2
I just realized that the function that adds numbers to the tree does not actually preserve the complete tree property! I really thought it was working!
It works for the first level (zero being the...
Just a sidenote!
in the add function should be like this:
void add(int x, node** root){
node* new_node = (node*) malloc(sizeof(node));
...
Ok, no problem!! I will just go with adding a level! it may work! who knows!?
Rebalanced tree? Nothing will change when you heapify a tree but the values, it is just a matter of swapping nothing else, I mean I should not add any pointer!
Or so I thought! :):)
You mean like, adding an int to the structure where I store the level?
What the hell di I wrote? it is "in the sense" not "in the sun", I just finished reading "Men in the sun"..that explains it! :)