Search:

Type: Posts; User: Heisenberg800

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    687

    C - TCP Server/Client Example

    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...
  2. Replies
    3
    Views
    1,065

    Nah it returns the sum. And "alg" is the function...

    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. :)
  3. Replies
    3
    Views
    1,065

    Average value of recursive function

    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...
  4. I solved my own problem. :) The line 2 in main.c...

    I solved my own problem. :) The line 2 in main.c was supposed to be placed inside "int main()".
  5. Ok sorry will try to edit that out. Line 2 in...

    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...
  6. Modular programming in C (Call functions between source file)

    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)...
  7. Replies
    7
    Views
    1,170

    Yeah you are right Tim. I'm just stressed cause I...

    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...
  8. Replies
    7
    Views
    1,170

    I got some code but it's not working 100%. The...

    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>
    ...
  9. Replies
    7
    Views
    1,170

    This is not an assignment, just a problem from an...

    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.
  10. Replies
    7
    Views
    1,170

    C Structure and file management

    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...
  11. Replies
    1
    Views
    5,647

    Write and read struct to txt file

    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...
  12. Replies
    6
    Views
    1,072

    I solved the problem by changing the if statement...

    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...
  13. Replies
    6
    Views
    1,072

    Delete this post

    Delete this post
  14. Replies
    6
    Views
    1,072

    Thanks userxbw! Your help is much appreciated. I...

    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...
  15. Replies
    6
    Views
    1,072

    Sorting chars in alphabetical order

    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...
  16. Replies
    5
    Views
    876

    Thanks i tried your code but it still loops and...

    Thanks i tried your code but it still loops and freezes after the last name is added. :( hmmm
  17. Replies
    5
    Views
    876

    Ok thanks for your feedback.:)

    Ok thanks for your feedback.:)
  18. Replies
    5
    Views
    876

    Loop error

    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...
Results 1 to 18 of 18