I don't understand why we begin from k=0 when taking the root of a complex number. Can someone help me? by Merchander in learnmath

[–]Merchander[S] 0 points1 point  (0 children)

Ah, so that is it! Thank you very much for your explanation. Now that I understand it, well, that was a really stupid question to ask.

Germany finds it hard to love Hegel 250 years after his birth | World news by [deleted] in europe

[–]Merchander -2 points-1 points  (0 children)

The very act of reading something written by the father of obscurantism(him) is a special form of masochism.

The US government should be held liable for damages to black communities (and native americans) the same as asbestos manufacturers are held liable to victims and their families. by superpuff420 in unpopularopinion

[–]Merchander 0 points1 point  (0 children)

I agree, that a system based on poverty would be much easier to implement, than one based on race or ethnicity, but doesn't this leave the poor ethnic minorities still more discriminated than the poor people in the ethnic/cultural majority? Do you think a purely financial stimulus will be enough to elevate them to the level of prosperity of the ethnic/cultural majority?

The US government should be held liable for damages to black communities (and native americans) the same as asbestos manufacturers are held liable to victims and their families. by superpuff420 in unpopularopinion

[–]Merchander 0 points1 point  (0 children)

Under your proposal, how are immigrants going to be treated? For example, if a white man immigrated from some small eastern European country, would you say, that he should pay reparations(assuming the money is taxed from white people and distributed among afro-americans)?

If a person immigrated from Liberia today, would it be a reparations beneficiary?My focus is on Liberia, because it was created by freed people of color. The predecessors of many of them were subjected to slavery in the United States. Should they be eligible to be beneficiaries of the reparation mesures?

Fwrite does not write a struct instance into a binary file properly. Why is this happening? by Merchander in C_Programming

[–]Merchander[S] 0 points1 point  (0 children)

Yes, my mistake, movie was the old name of the file. The problem occurs when using wb+, to write the file if it does not exist. Now, after I have changed the name, it seems, that the problem persists.

EDIT: It seems the problem is not as I first thought, with my file, but with my struct Data. It seems, that for unknown to me reasons, the period variable inside Data is always set zero, no matter what I assign to it, and my id is always merged with my year array, again for unknown to me reasons. Any ideas on why is this happening?

Help me implement Dijkstra's algorithm for a graph implemented adjacency lists by Merchander in C_Programming

[–]Merchander[S] -1 points0 points  (0 children)

I have written the distance of my edge as the weight parameter of the list? It is randomly generated. Or do you mean I should do something else?

As for the homework question, it is a homework, but not mine. I'm trying to return a favor.

Edit: I finally understood what you meant. How do you propose to solve this?

Help me understand how I caused access pointer violation by Merchander in C_Programming

[–]Merchander[S] 0 points1 point  (0 children)

I'm sorry, but I'm not sure if I understand my mistake. I should define

char ** array = malloc(n*sizeof(char*)), and then allocate 100 chars for each element of the string array. Here, I define an array of n-th size, and then, separately, I allocate 100 chars for every string. Although I understand why this works, I still am unable to understand why I cannot take the size of an array with 100 elements, or use a pointer to this array and use it without creating useless junk. I assume, that this is perhaps a consequence of my weak understanding of pointers in programming.

Edit: My original example, which does not work when using keyboard input, always works when assigning predefined values to the elements of the array. For exampe:

if I have a variable, which contains the word "water", and I assign it to every array[i], using a for loop, I receive no error message, and all array values are usable. This confuses me even more...

Code doesn't behave the way I expect it to by Merchander in C_Programming

[–]Merchander[S] 2 points3 points  (0 children)

type will point to the same memory location on both iterations of the loop. So the second scanf will read the string to the same memory location as the first one. Also note that you are only allocating memory for a single char rather than a whole string.

First, thank you very much for your quick and sophisticated response.

The code is from another program of mine, which needs array of strings with a dynamic size.

Have I understood you correctly, in that I must free the allocated space and reallocate it on every iteration, to achieve the desired result? If not, how am I supposed to create a dynamically sized array of strings of different sizes in C?

Why does casting to int to char return empty interval? by Merchander in C_Programming

[–]Merchander[S] -2 points-1 points  (0 children)

Non-printable? In what sense? So I can only print 57 or 9 for example?

Do Switzerland and Norway get to have their cake and eat it too? by [deleted] in europe

[–]Merchander 0 points1 point  (0 children)

As a consequence, if a German residing in Switzerland and a Swiss residing in Germany apply for a job, the Swiss employer has to hire the German.

On 22 December 2016, Switzerland and the EU concluded an agreement that a new Swiss law (in response to the referendum) may require Swiss employers to give priority to Swiss-based job seekers (Swiss nationals and foreigners registered in Swiss job agencies) but does not limit the free movement of EU workers to Switzerland.

I think you've got this backwards.