Search:

Type: Posts; User: Imara

Search: Search took 0.01 seconds.

  1. Of course! I replaced 1025 with strlen(buf) and...

    Of course! I replaced 1025 with strlen(buf) and it works now, thank!
  2. it works now #include #include...

    it works now


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    int main(int argc, char *argv[])
    {
    if (argc < 2)
  3. How to give an error instead of program shutting down when there´s no argument to mai

    Hi!

    I need my program to give an error instead of shutting down when there is no argument given to main. I don´t understand where I need to check if there is an argument as that is the first...
  4. Replies
    2
    Views
    1,056

    No worries, I got it :)

    No worries, I got it :)
  5. Replies
    2
    Views
    1,056

    Counting words in an string

    My program has to count the amount of times the word given as an argument to main is given by the user. This all worked untill I added the bit where the program has to exit when EOF is the input.
    ...
  6. Replies
    13
    Views
    1,370

    Thank you so much! It works now!!

    Thank you so much! It works now!!
  7. Replies
    13
    Views
    1,370

    for clarity, my outcome is: 2.00000e+000...

    for clarity, my outcome is:
    2.00000e+000 4.00000e+000 2.00000e+000
    4.00000e+000 4.00000e+000 4.00000e+000
    1.00000e+000 1.00000e+000 9.00000e+000
    1.00000e+000 1.00000e+000 1.00000e+000...
  8. Replies
    13
    Views
    1,370

    New and improved code: void swap (double...

    New and improved code:


    void swap (double **p, double **q); /* wissel de pointer waardes om */
    double length (double v[], int dim); /*...
  9. Replies
    13
    Views
    1,370

    I inserted the asserts, but the outcome of the...

    I inserted the asserts, but the outcome of the code did not change.

    My program once more:



    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <assert.h>
  10. Replies
    13
    Views
    1,370

    At first it didn´t finish the program at all. Now...

    At first it didn´t finish the program at all. Now it only returns 0´s, while I need the scanned values, but I can´t find anything wrong with the scan or print functions. I´ll check the callocs, u...
  11. Replies
    13
    Views
    1,370

    I´m sorry, that was actually the part that I...

    I´m sorry, that was actually the part that I already changed whilst waiting for reply, and it still doesn´t work. Here´s the code I have currently




    #include <stdio.h>
    #include <stdlib.h>...
  12. Replies
    13
    Views
    1,370

    The scanf part was the bit that was assigned as a...

    The scanf part was the bit that was assigned as a task to us, so that should be righ. It scans in as a long e notation, so the scientific 0.0000000e00
  13. Replies
    13
    Views
    1,370

    I changed the printing part to for (i...

    I changed the printing part to



    for (i = 0; i < num; i++){
    for(j = 0; j < dim; j++){
    printf("%lf ", w[i][j]);
    }
    printf("\n");
    }
  14. Replies
    13
    Views
    1,370

    Sorting a 2d vector, pointer trouble

    Hi. I´m kinda new to the pointer and multidimensional arrays. I need an input for the number and dimensions of an array. Than scan these and, sort the vectors and print them again. Only, every time I...
  15. I just put in everything u guys said, and it...

    I just put in everything u guys said, and it works like a charm, thanks so much!
  16. Error: decleration expected after usage of SWITCH/BREAK

    Hi! I have to make a 2D home plan of my house for an assignment and run the user through all the different rooms, by letting them chose the direction they want to go. As I'm not that far yet, I've...
Results 1 to 16 of 16