Search:

Type: Posts; User: ymc1g11

Search: Search took 0.01 seconds.

  1. Replies
    21
    Views
    12,067

    c99tutorial, that is to check...

    c99tutorial,

    that is to check size+indexwherecurrentelementiszero does not go out of bound of array length.

    and 'size' is not the size of 'array', it is the size of pointer to the array where i...
  2. Replies
    21
    Views
    12,067

    Andreas, No, what I want is the pointer....

    Andreas,

    No, what I want is the pointer. Here's my code:



    int * mymalloc(int *array, int size){
    int i = 0;
    /*array is initialised with 0's
    a non zero means the array at...
  3. Replies
    21
    Views
    12,067

    Hi c99tutorial, Yea that was what I had been...

    Hi c99tutorial,

    Yea that was what I had been doing.

    but what i wanted is: say i have an array of length 20 passed into my function. but then I wanted my function to return the location of,...
  4. Replies
    21
    Views
    12,067

    Hi, found my solution not working again :/ so...

    Hi,

    found my solution not working again :/ so im trying to do it in ur way.

    so i wrote my function as follow:


    int *pointer;
    int j;
    for(j=0;j<size;j++) &pointer[j] = &array[j+size];
  5. Replies
    21
    Views
    12,067

    Hi Andreas, I think the solution you provided...

    Hi Andreas,

    I think the solution you provided requires me to use malloc for ptr first, which I should'nt be doing (I should have said this sorry).

    Anyway, I got it working by using *pointer[],...
  6. Replies
    21
    Views
    12,067

    SAMARAS, well actually i wasn't trying to...

    SAMARAS,

    well actually i wasn't trying to find out the length of the array after the negative value.

    i is actually the position where i want the pointer to point to.

    By returning pointer,...
  7. Replies
    21
    Views
    12,067

    Hi SAMARAS, is it possible to pass an...

    Hi SAMARAS,

    is it possible to pass an explicit length of the array? for example the memory location from array[i] to array[i+size]?

    Thanks in advance~!
  8. How to find out the length of the array pointed by a pointer?

    Hi all,

    i passed an array of integer


    int myarr[10];

    into a function like this:
  9. Replies
    21
    Views
    12,067

    How to return pointer of a sub array?

    Hey all~

    I am writing a function which takes an array as parameter and returns the pointer to the part of the array which had not yet been written with negative values. In the beginning I had...
  10. Replies
    5
    Views
    940

    Hi Andreas, With your advice, the problem is...

    Hi Andreas,

    With your advice, the problem is sorted. :D

    But I have a few questions:
    Here is how my sortwords looks like:

    int storewords(char **warr, char *w){ int wc = 0;
    char **buffer =...
  11. Replies
    5
    Views
    940

    problem with storing strings

    I have this function which convert all alphabets of a given string into lower case:

    void to_lower(char *input, char *output){ unsigned int i, j;
    for (i = 0, j = 0; input[i] != '\0'; i++) {
    if...
  12. Replies
    2
    Views
    1,434

    sorted! cheers!

    sorted! cheers!
  13. sorted! cheers! :D

    sorted! cheers! :D
  14. sorry i just cant get my head round it as a...

    sorry i just cant get my head round it as a beginner

    so i should declare it in my main as this:

    struct tnode *root;

    and in my method sort,
    -how do i check if the 'root' had been assigned...
  15. laserlight, here's the struct i created: ...

    laserlight,

    here's the struct i created:


    struct tnode {
    char *word;
    int count;
    struct tnode *left;
    struct tnode *right;
  16. Hi qny, When I tried to do that, it gave me...

    Hi qny,

    When I tried to do that, it gave me "invalid operand to binary ==" error..
  17. assign null value to a struct and check if it is null

    Hi everyone,

    I want to initialize my struct with a null value, and at some point check whether the struct is null.



    struct mystruct s = {0};


    and then when i need to check it:
  18. Replies
    2
    Views
    1,434

    Sorting by passing struct as argument

    Hi,

    I am writing a program that takes input fr stdin, breaks it into tokens of words, and then count the occurrence of the each word by sorting them into a tree of struct.

    however when i tried...
Results 1 to 18 of 18