Search:

Type: Posts; User: nerio

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    3,563

    It compiles. It runs. But when I enter the three...

    It compiles. It runs. But when I enter the three values and then press Enter, it doesn't do anything.

    EDIT:

    I have a similar program for adding two integers that works, but I don't see why the...
  2. Replies
    8
    Views
    3,563

    add three integers function

    Hello.

    I am trying to write a program that adds three integers. It does not run. Where is the mistake?


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

    int addthreeintegers(int i,int j,int k);
  3. Replies
    3
    Views
    1,009

    copying strings does not work, why

    Hello.

    I am trying to copy the content of one string into an another. But it does not work. Why not? Here is the code:


    #include <stdio.h>
    #include <stdlib.h>
    #include <ctype.h>
    #include...
  4. Are you guys from the same school having the same...

    Are you guys from the same school having the same teacher telling you to do this particular assignment?

    http://cboard.cprogramming.com/c-programming/148955-atm-file-processing.html...
  5. Replies
    2
    Views
    410

    I would read the file line by line, parse the...

    I would read the file line by line, parse the strings and convert the desired ones from a string to a double and then compute the ar. mean.

    Alternatively you can simply copypaste it and compute it...
  6. Replies
    8
    Views
    793

    It does not mean "pyramid number". Pyramid...

    It does not mean "pyramid number".

    Pyramid number is defined as a sum P_n=1^2+2^2+3^2+...+n^2, while this guy has for entry 421 output 14, 15 (14^2+15^2, which is a difference P_15-P_13, and no...
  7. Replies
    7
    Views
    1,387

    In English language it is called orthogonal. ...

    In English language it is called orthogonal.

    https://en.wikipedia.org/wiki/Orthogonality




    #include <stdio.h>
    #include <stdint.h>
  8. five questions about dynamic memory allocation

    Q0: What is the real purpose of malloc(), realloc() and free() functions?

    I have read that they enable to allocate memory in cases when the amount of memory to be allocated is unknown. But in that...
  9. Replies
    9
    Views
    734

    Here is how to do if statements in C: ...

    Here is how to do if statements in C:

    if...else statement in C
  10. Thread: string program

    by nerio
    Replies
    12
    Views
    1,194

    In the code that I posted in post #5...

    In the code that I posted in post #5 there is a mistake in comparing chars. I find it pretty difficult to compare char variables.



    if(buffer[i]=="a" || buffer[i]=="e" || buffer[i]=="i" ||...
  11. Thread: string program

    by nerio
    Replies
    12
    Views
    1,194

    @ Matticus : Maybe he understands what I do not...

    @ Matticus : Maybe he understands what I do not and I understand what he does not. And from an incorrect code one can learn to identify mistakes. Maybe instead of writing it all from zero he can...
  12. Thread: string program

    by nerio
    Replies
    12
    Views
    1,194

    Here is my code, it does not work, but maybe it...

    Here is my code, it does not work, but maybe it will help you.

    I tried to debug it, the problem part will be the loop at the end.


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>...
  13. Thank you for replies. The entering of negative...

    Thank you for replies. The entering of negative value I have already mentioned in post #3. Thank you for helping me to get to these thoughts.

    Original problem is solved now.

    I am also...
  14. @laselight : reading one by one requires to know...

    @laselight : reading one by one requires to know when do you stop. That requires to know number of items, which is not given. And asking when to stop after every entry is the 1) solution.

    Or a...
  15. compute arithmetic mean without knowing the number of items

    Hello.

    I am working on a program that will compute arithmetic mean of certain number of real numbers (in C double) without knowing the number of items.

    I can think of two solutions.

    1) I can...
  16. Thank you all. Here is the current version: ...

    Thank you all.

    Here is the current version:


    #include <stdio.h>

    int main()
    {
    int i,j;
  17. Post number three of this thread contains a...

    Post number three of this thread contains a corrected version.

    So the formatting is about number of spaces between a code starts on a line and between spaces between lines of different type of...
  18. I think that the one I used is the Allman style....

    I think that the one I used is the Allman style.

    https://en.wikipedia.org/wiki/Indent_style#Allman_style

    I see it now. For the code more on the right I used the Whitesmiths_style..
    ...
  19. how to properly indent and format a source code?

    Hello.

    I want to learn how to indent and format properly my source codes. I have found this online:

    https://en.wikipedia.org/wiki/Indent_style
    GNU Coding Standards: Formatting

    Here is a...
  20. Have a look here...

    Have a look here.

    Also, if you call the function in the main, just use foo() instead of foo(void).
  21. Replies
    2
    Views
    1,860

    why does every character get printed twice?

    I am working on a program that prints "How are you?" on the screen by printing byte by byte.

    First I wrote


    #include <stdio.h>
    #include <stdlib.h>
    int main()
    {
    putchar(72);
  22. Do you have a specific example in mind? Like...

    Do you have a specific example in mind?

    Like you are given points and possibly also degree and you want to know the coefficients?

    You could use linear regression, or in general polynomial...
  23. Your question is too much wide to answer. In...

    Your question is too much wide to answer.

    In general a polynomial can have any coefficients (if you meet the condition a_n is not 0).

    It would help to know what is given. Do you know points on...
  24. I intend to write a program that XORs two given...

    I intend to write a program that XORs two given files, until the length of the shorter one. As an exercise I was advised here to write a different program first that will copy a given file.


    ...
  25. Is better an array or a structure for that? I...

    Is better an array or a structure for that?

    I have currently two versions (both are inspired by from c - Copying Binary Files - Stack Overflow)

    Could you please help me with it? I do not have a...
Results 1 to 25 of 87
Page 1 of 4 1 2 3 4