I want to implemment ipc as is described in the comments. I'am having trouble with the stat sys call. After receiving file name in server if i write
printf("%ld\n", st.st_size); i get 1 when the...
Type: Posts; User: telmo_d
I want to implemment ipc as is described in the comments. I'am having trouble with the stat sys call. After receiving file name in server if i write
printf("%ld\n", st.st_size); i get 1 when the...
Sorry about that, here's the code:
#include <stdio.h>
void quicksort(int *a, int start, int end);
int partition(int *a, int start, int end);
void print_array(int *a, int len);
void...
Can anyone tell me what's wrong with my quicksort? It seems fine but when i run it seg faults. I've been looking for some time but can't figure out the problem.
void quicksort(int *a, int...
I thought i had figured out it works on my system that is just allocated space and then put variable starting at the end of the allocated space in the order they appeared. Turns out that's not...
Stack grows from high memory to low memory. Knowing that i declared 3 variables and was expecting that the first declared would have the biggest address, and the last one the lowest. It didn't turn...
I did print the addresses. Interesting output. They get laid out one right after the other, in the order they appear on the code. But once again how are they actually linked?
in main() var = 5,...
How are they linked to their functions? Once a function does it's job it's effectively gone. When it comes again it has to know which static variable to use and there may be many with the same name....
Hi. My understanding of functions is that whenever there is a function call stack space is allocated for that function and local variables are stored there and when a function does its job all those...
As an exercise i'am implemmenting a simple shell and now i'am trying to implemment foregorund and background.
All i know about this at the moment is that if there an & after a command it runs on...
Now i see. Thanks.
Why is it a error in this block of code if child process reaches line after execvp()?
Does the child run the wait system call too if it happens to execute first? Or is the wait() function only for...
Thanks that fixed the problem.
Linux Mint and i'am using nano.
I'am getting this error when i try to run make. I think its the damn tab. I wanted to add some files to the makefile however i noticed that my tabs aren't the same as the ones that were already on...
Didn't work but solved it by installing package build-essential. If anyone has same problem this could solve. This was a fresh linux mint installation.
Whenever i try to compile with either gcc or cc i get following error:
fatal error: sys/types.h: No such file or directory
#include <sys/types.h>
I did this command that i found with a search...
Never mind just realized this is Pythagorean theorem, i just have to think of radius as hypotenuse.
I know from searching the internet that x and y must satisfy (x - center_x)^2 + (y - center_y)^2 < radius^2.
However i'd like to develop some intuition for this not just know the formula but...
Thanks that solved that particular problem. Now i get a another one: 'BinaryTreeNode' is not a template
I'am i doing it right?
#include <iostream>
#include <memory>
using namespace std;
Ecplise says "Symbol 'unique_ptr' could not be resolved". How to correct this? I tried using flag -std=c++0x or -std=c++11 like this:...
I need an array that in start of iteration need to be all zeros. Is it better to free it at end of iteration and call calloc at start of each iteration or its better to run a for loop at the end to...
I have a file with a bunch of numbers to read that i want to store in structure like a Person that has age, id and so on.
There are 2 problems. First is that each line either has one of the things...
Yes how i would like to know what is used to store the current line when that call stops so that when it that call works again it knows which work already is done.
When a function calls it self in preorder travelsal how does it know when it goes back to that same node that left child is already visited?
array[i++] = 5;
array[i++] = //super long expression
I know first one works fine now with second i was never confident so up to now i played it safe by doing i++ on separate statement.
I'd...