Search:

Type: Posts; User: JohnnyC

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    6,435

    Oh yea lol I forgot about that (reserved word as...

    Oh yea lol I forgot about that (reserved word as a header guard name), thanks I got rid of the struct.h file errors. But I got a dozen new ones :D
  2. Replies
    3
    Views
    6,435

    Header file error

    I'm using a makefile, but anyways this is my struct.h file


    #ifndef struct
    #define struct

    typedef struct person{
    char *name;
    int socialNum;
    char *dateOfBirth;
  3. Replies
    7
    Views
    1,080

    Ok I'm gonna inform myself a bit more about when...

    Ok I'm gonna inform myself a bit more about when NULL should be used.

    Thanks to everyone for helping me :)
  4. Replies
    7
    Views
    1,080

    Sometimes I use a decimal 0 or a char [NULL]

    Sometimes I use a decimal 0 or a char [NULL]
  5. Replies
    7
    Views
    1,080

    If someone could explain.

    Why does this print 1, I thought it should print 0 since there is nothing in it and strlen dosn't count the \0 at the end of the string.



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

    int main ()...
  6. Thank you guys. I mean this is my homework and I...

    Thank you guys. I mean this is my homework and I wont get a Note so in that way its not important.
    But stuff like this should be in my exam, so thats why I really want to know how to do it. And my...
  7. Trying to count vowels... in every word of a string.

    I have been working on this for a long time with no success,
    so yea what am I doing wrong here.
    I'm trying analyze every word of a string, that means vowels, numbers, signs, and constants.


    ...
  8. Thread: Need help.

    by JohnnyC
    Replies
    2
    Views
    486

    Thank you :)

    Thank you :)
  9. Thread: Need help.

    by JohnnyC
    Replies
    2
    Views
    486

    Need help.

    So I made this program, its purpose should be to for example I write a text and It needs to see how many words there are, how many vowels and so on...




    #include <stdio.h>
    #include <string.h>...
  10. Replies
    4
    Views
    3,657

    Thanks, so yea for sscanf() I found this "On...

    Thanks, so yea for sscanf() I found this "On success, the function returns the number of variables filled". So that explains the !=5.

    As for fgets(), it reads a line from the specified stream...
  11. Replies
    4
    Views
    3,657

    If someone could explain this.

    Hello and thank you for taking your time to expalin me some things :)

    So I didn't write this program, I found it online so I would like to know some things a bit more.

    This is a program that...
  12. Thread: Need help.

    by JohnnyC
    Replies
    4
    Views
    2,971

    Shortly after you told me that I managed to do...

    Shortly after you told me that I managed to do it, I looked online how someone else did the average and saw he did something similar to what I tried but the only thing was I wrote float where I...
  13. Thread: Need help.

    by JohnnyC
    Replies
    4
    Views
    2,971

    You mean generally in math? then yes. Sum divided...

    You mean generally in math? then yes. Sum divided by number of elements.
    But idk how to make a sum of the characters that are str1[i]==str2[i].
    Thanks for the reply :)
  14. Thread: Need help.

    by JohnnyC
    Replies
    4
    Views
    2,971

    Need help.

    So this is what I need to do:
    https://i.imgur.com/aqw0tzg.png
    https://i.imgur.com/hok4ozL.png

    Im stuck at the return the avrage value of the substrings that is a match. Idk how to make an...
  15. Thread: Need help.

    by JohnnyC
    Replies
    9
    Views
    1,707

    Long lost father? But yea it works :D Thanks a...

    Long lost father?

    But yea it works :D Thanks a lot



    int main()
    {
    signed int a;
    signed int b;
  16. Thread: Need help.

    by JohnnyC
    Replies
    9
    Views
    1,707

    Thats the result I'm getting when I put 20 and...

    Thats the result I'm getting when I put 20 and -33 using | instead of +.
    If I use + I get 85899345887.

    While I should be getting 90194313183
  17. Thread: Need help.

    by JohnnyC
    Replies
    9
    Views
    1,707

    Did but I still dont get the correct result for...

    Did but I still dont get the correct result for 20 -33
    18446744073709551583
  18. Thread: Need help.

    by JohnnyC
    Replies
    9
    Views
    1,707

    44 in hex 0x2C 88 in hex 0x58 188978561112 in...

    44 in hex 0x2C
    88 in hex 0x58
    188978561112 in hex 0x2C00000058

    So what I got from this is that I gotta move the first number 32 bits to the left so <<32 and then add the second number and yea...
  19. Thread: Need help.

    by JohnnyC
    Replies
    9
    Views
    1,707

    Need help.

    So this is what the assignment says:

    - I need to write two whole numbers using signed int
    - I need to save these two numbers in a unsigned long long variable with the help of Bitshift
    - Print...
  20. Thread: Need help.

    by JohnnyC
    Replies
    3
    Views
    942

    yea its said that we need to use 2 loops but tbh...

    yea its said that we need to use 2 loops but tbh im super new to programming so idk what i need to change there so i can make it with while do

    edit: just got a friend to send me his result i get...
  21. Thread: Need help.

    by JohnnyC
    Replies
    3
    Views
    942

    Need help.

    So basicly I have some homework to do, useing for and then while do I need to write this
    1 x 1 = 1

    2 x 1 = 2

    3 x 1 = 3

    ...
    9 x1 = 9
Results 1 to 21 of 22