Search:

Type: Posts; User: zel

Search: Search took 0.01 seconds.

  1. Replies
    25
    Views
    4,734

    Yes I'm gonna fix that. Thank u again :)

    Yes I'm gonna fix that. Thank u again :)
  2. Replies
    25
    Views
    4,734

    Ok, it was that simple and I've stuck here for so...

    Ok, it was that simple and I've stuck here for so much time...:$


    for (i=0;i<N && str2[i]!='\0';i++){
    str1[i]=str2[i];
    }
    str1[i]= '\0';

    I don't know why I think so...
  3. Replies
    25
    Views
    4,734

    Haha. I see that. OK. it runs properly...

    Haha. I see that.

    OK.
    it runs properly except :
    1) that if eg. len2=5 and I give 5 as N,it does no changes.
    and
    2)if eg. len2=5 and I give 10 ,it never goes out of the loop.

    gr..I made it...
  4. Replies
    25
    Views
    4,734

    Oh sorry. I didn't see your answer. Is my code...

    Oh sorry. I didn't see your answer. Is my code now correct?
  5. Replies
    25
    Views
    4,734

    So I did this: void copy( char* str1,char*...

    So I did this:


    void copy( char* str1,char* str2, int N) {

    int i,len1,len2;

    for (i=0; str1[i] != '\0'; i++){
    len1= i;
    }
  6. Replies
    25
    Views
    4,734

    ok here's another problem. I want to copy the...

    ok here's another problem. I want to copy the first N characters from a string1 to a string2 and erase the rest characters of string1 BUT without using any string function from <string.h>.

    So if...
  7. Replies
    25
    Views
    4,734

    Ok problem solved. Thank u again :)

    Ok problem solved. Thank u again :)
  8. Replies
    25
    Views
    4,734

    ok I also added 2 free. free(pX);...

    ok I also added 2 free.


    free(pX);
    free(pY);


    I'm confused at the 2nd part of your answer. you mean I don't have to use str1 and str2 but pX and pY instead?
    ps.sorry if my English is bad
  9. Replies
    25
    Views
    4,734

    so it has to be: [ pX = (char *) malloc(20*...

    so it has to be:


    [
    pX = (char *) malloc(20* sizeof(char) );
    pY = (char *) malloc(20* sizeof(char) );
    /CODE]

    right?
  10. Replies
    25
    Views
    4,734

    Ok. How about this one? My warnings are: In...

    Ok. How about this one?

    My warnings are:

    In function ‘main’:
    line 11: warning: assignment makes integer from pointer without a cast
    line 12: warning: assignment makes integer from pointer...
  11. Replies
    25
    Views
    4,734

    oops..ok I found the mistake thx 2 u. nice :)

    oops..ok I found the mistake thx 2 u. nice :)
  12. Replies
    25
    Views
    4,734

    A "wrong type" warning

    I am writing a programme..and it's so simple but I get this warning all the time.

    warning format ‘ d’ expects type ‘int ’ but argument 2 has type ‘char *’

    What could have gone wrong?
Results 1 to 12 of 12