Search:

Type: Posts; User: jackhasf

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    1,301

    no i haven't showed him anything yet but I...

    no i haven't showed him anything yet

    but I guess I will. I lost 1 hour while taking the exam trying to understand the reason why he would do something like this

    well about making the function...
  2. Replies
    10
    Views
    1,301

    i don't think it was a trick question because the...

    i don't think it was a trick question because the problem was clear

    it wanted us to transform this function into another function that uses no recursion but does the same thing

    nevermind, i ll...
  3. Replies
    10
    Views
    1,301

    my friend, thanks for the answer you should...

    my friend, thanks for the answer

    you should tell this to my professor

    he put this problem on our exams today and it's DRIVING ME CRAZY

    that's why im asking here

    thanks again
  4. Replies
    10
    Views
    1,301

    hi thanks for the answer i swear i ve spent...

    hi thanks for the answer

    i swear i ve spent more than 5 hours to understand what it does but i just can't

    i can't understand why the output can be different when declaring the arrays in a...
  5. Replies
    10
    Views
    1,301

    im having BAD trouble with this recursion

    ok I CANT understand the logic of this recursion

    the function is this:



    void f(int A[], int n, int B[]){

    if (!n)
    f(A,n-1,B);
  6. thanks a lot :)

    thanks a lot :)
  7. ok i understand why it gives -6 now because we...

    ok i understand why it gives -6 now

    because we have 4 digits and the forth one is 1(<0) then it takes all the digits and changes them from 1010 to 0101 and adds 1 to the end so 0110

    am i right?...
  8. 2 questions about bit fields and variable handling

    1 question:



    #include <stdio.h>

    struct foo{
    int a:4;
    };
  9. Replies
    10
    Views
    1,445

    thanks MK27 i have one more question what's...

    thanks MK27

    i have one more question

    what's the probability of this variable to contain a normal string of 3 characters?

    i mean if we would make printf("%s",x) what's the probability of this...
  10. Replies
    10
    Views
    1,445

    question about variables

    hi

    if we have this code

    char x[10];

    just this code nothing else, can we know what there might be inside the elements of the array?

    if you print an element for example printf("%c",x[5]) it...
  11. Replies
    4
    Views
    2,195

    string reversion using recursion

    hello guys im practicing my recursion skills and i found this problem somewhere
    that wants to reverse a string recursively so if we have for example "abc" it will make it "cba"

    this is my try

    ...
  12. Replies
    11
    Views
    2,540

    ofcourse i wanted to change things, but you kept...

    ofcourse i wanted to change things, but you kept saying that my code and thinking was wrong without telling me why
  13. Replies
    11
    Views
    2,540

    thanks again for the reply True, but, i...

    thanks again for the reply



    True, but, i don't want to count numbers, that's why I did what I did and in this program if you have the fahrenheit 451 input, you will get 1 as a result, which is...
  14. Replies
    11
    Views
    2,540

    also for different inputs i get " 1234 Hello...

    also for different inputs i get

    " 1234 Hello world 2340923042 how are you " = 5


    " 1234 Hello world asdasdasdasd asdas das da sd asd 2340923042 how are you " = 11
  15. Replies
    11
    Views
    2,540

    thanks for the reply, it was my fault not to say...

    thanks for the reply, it was my fault not to say that we dont count numbers as words

    new line characters, commas etc and punctuations will not be included in the string

    also, why do you say...
  16. Replies
    11
    Views
    2,540

    number of words in a string

    hi everyone, i made this code but i'm not sure if it's 100% correct




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

    int count(char x[]){
  17. Replies
    7
    Views
    1,593

    i think i return it i have return count[0]; ...

    i think i return it

    i have return count[0];

    do you mean anything else?
  18. Replies
    7
    Views
    1,593

    hi thanks for the reply but how can i do this...

    hi thanks for the reply

    but how can i do this without using the variable count? I used it to count the number of times the target appears in the specified array
  19. Replies
    7
    Views
    1,593

    yea i know what i meant is that i'm not using any...

    yea i know what i meant is that i'm not using any for/while/do while loops inside the function to get the desired result
  20. Replies
    7
    Views
    1,593

    i solved this recursion, is it correct?

    Write a recursive function that searches an array of integers of size N and returns the number of integers equal to a target value

    so all i did was this:


    #include <stdio.h>
    #include...
  21. thanks :)

    thanks :)
  22. i need help with this function, I can't get sizeof(char) to work properly

    this code works like this

    lets say we have a string word' = "abcdabc";

    and we want to erase a word that is included in word'

    if word = "abc" we want to make word' = " d ";

    i ve done...
  23. Replies
    8
    Views
    1,344

    question about strings

    why do we have to declare a string like

    char *x = "...";

    or char x[] = "...";

    ?


    also if i say char x[];
  24. Replies
    3
    Views
    1,107

    question about variable initializations

    let's say we have this code



    main()
    {
    int k;
    while (k!=0)
    {
    scanf("%d",&k);
  25. thank you very much again :)

    thank you very much again :)
Results 1 to 25 of 33
Page 1 of 2 1 2