So I can run the server code with:
./server
But how can I run the client code?
I tried with:
./client name file.txt
"42416 segmentation fault (core dumped)"
Where “name” is the...
Type: Posts; User: Heisenberg800
So I can run the server code with:
./server
But how can I run the client code?
I tried with:
./client name file.txt
"42416 segmentation fault (core dumped)"
Where “name” is the...
Nah it returns the sum. And "alg" is the function of the algorithm that also returns the "clock-time" of that specific algorithm. "n" are the number of times the function is asked to run. :)
This function returns the sum of "n" different values. (The running time of an algorithm) But I want the function to return the average value of all those values instead of the sum. Anyone got any...
I solved my own problem. :) The line 2 in main.c was supposed to be placed inside "int main()".
Ok sorry will try to edit that out.
Line 2 in main.c is my attempt to call the function that reads in from file to the directory. The problem is that that function is in the other source file. So...
Ok so I'm having some troubles with understanding modular programming in C. My program is split-up in three parts.
"main.c" - Code for the menu and function calling. (Vehicle Directory)...
Yeah you are right Tim. I'm just stressed cause I have test in a few hours. Will probably fail this one oh well. Do you know how one could read from files to save to structures? I don't get how we...
I got some code but it's not working 100%. The function that reads a file and saves in to a structure would be awesome if someone could get it to work.
#include <stdlib.h>
#include <stdio.h>
...
This is not an assignment, just a problem from an old test. Ye I think I know the functions, but maybe not when working with structures. Thanks will look it up.
a) Create a structure that contains information about a book, title, actor and year of publication.
b) Write a function that saves the structure to a file, without deleting the information in the...
Part of the program is in swedish. But i have translated the menu.
My question is basically how to get fwrite and fread to work with my "structure"
My program inputs data from user and saves...
I solved the problem by changing the if statement to this
(strcmp(f[i].marke, f[j].marke) > 0 && f[j].marke[0] != '\0')
The empty posts seemed to create the problem. So i made sure to not if...
Delete this post
Thanks userxbw! Your help is much appreciated. I implemented your code to my program. Thanks for introducing "strcmp". That's new to me and i will look more in to that.
However it still don't work...
Ok so part of my program is in swedish sorry for that. My program basically inputs name of car owner, and car brand. And stores that data in a list of max 10 posts.
Im trying to add a function...
Thanks i tried your code but it still loops and freezes after the last name is added. :( hmmm
Ok thanks for your feedback.:)
Hi im new to programing. Im from sweden so part of the code is in swedish. I think that the error might be easy to spot .If not i can translate the whole code.
The program runs. Menu option 1...