Search:

Type: Posts; User: tinchi

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Ah ok, I get your point. I think I should just...

    Ah ok, I get your point. I think I should just use memcpy when I exactly know the lengths and if I am sure that I don't have some case like your example.. Thanks
  2. This is such an simple idea but I would have...

    This is such an simple idea but I would have never thought about it! I will write one myself, thank you!

    EDIT:


    Ok, that is also what I thought. But I read somewhere I should avoid using...
  3. of course I meant here: string[length +...

    of course I meant here:


    string[length + con_len] = '\0';
  4. String operations: strncat, strncpy used right?

    I wonder if I am using the string operations properly. So If i have a char array, and I want to copy another one into it, what I do is :



    char *example = "Example_string";
    int length =...
  5. Replies
    18
    Views
    1,463

    Thank you for your patience *jackass, and yes I...

    Thank you for your patience *jackass, and yes I have 64 bits.

    @anduril

    I only want to save the addresses, so I will also try your suggestion with the fprintfs. Thank you
  6. Replies
    18
    Views
    1,463

    Still not working well: char *exa =...

    Still not working well:




    char *exa = "0x1017bcee0";

    int **all_str = malloc(sizeof(char*)*100), **b = all_str;

    *all_str ++= exa;
  7. Replies
    18
    Views
    1,463

    Hmm your solution is not working for me, I just...

    Hmm your solution is not working for me, I just tried:




    char *my_example = "0x1017cbee0";

    int **all_str = malloc(sizeof(char*)*100), **b == all_strs;

    *all_str++= my_example;
  8. Replies
    18
    Views
    1,463

    Yes like is said in the second answer, pointers...

    Yes like is said in the second answer, pointers to ints, and then later I want to retrieve those pointers
  9. Replies
    18
    Views
    1,463

    I don't see how this is casting my string, it is...

    I don't see how this is casting my string, it is just saving it to a list? Oh but i thing it is my fault, I forgot to mention I have to save it in a list of pointers to ints, so int *my_list
  10. Replies
    18
    Views
    1,463

    Converting/casting a string to a pointer?

    I am wondering if it is possible that I cast a char array to a pointer. What I mean is I generate a text file containining pointers to some addresses, since I want to save memory, so I have something...
  11. Replies
    8
    Views
    1,990

    And what if I want to do it the other direction,...

    And what if I want to do it the other direction, is an (int) enough?
    Wow this is a really nice method. thank you a lot. I also managed to cast a address to a char:



    int lala = 0;

    ...
  12. Replies
    8
    Views
    1,990

    Undefined symbols for architecture x86_64: ...

    Undefined symbols for architecture x86_64:
    "_itoa", referenced from:
    _main in main.o
    ld: symbol(s) not found for architecture x86_64

    But sprintf does it for me. thank you really...
  13. Replies
    8
    Views
    1,990

    Cast an int to char

    Is it possible to get the string representation of an int. So I mean if i have:

    5, I want to get '5'.

    I was searching in the internet and I found this solution:




    int number = 5;
  14. Replies
    6
    Views
    5,471

    Hmm ok, I thought to use sort since it has a good...

    Hmm ok, I thought to use sort since it has a good worst case runtime, and stuff like bubble sort is quadratic so I don't know which one is my sorting algorithm i should use :S
  15. Replies
    6
    Views
    5,471

    Nobody has any suggestions :??

    Nobody has any suggestions :??
  16. Replies
    6
    Views
    5,471

    Array sort with qsort, by using two criteria?

    Hello!

    I already posted one question related to my quick sort problem, but since it is solved and I have a new one, I am starting a new thread. So I try to sort an array with qsort and then save...
  17. Replies
    6
    Views
    1,084

    Yes well I removed the error by just introducing...

    Yes well I removed the error by just introducing a separate function for swap:



    void switch_pos(int *one, int *two) {


    int temp = *one;
    *one = *two;
    *two = temp;
  18. Replies
    6
    Views
    1,084

    Oh yes and the do's in my first post are just...

    Oh yes and the do's in my first post are just typos!line 20, 21
  19. Replies
    6
    Views
    1,084

    #include #include #include...

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

    int main(int argc, char** argv) {


    int tot = 10; int ini;
    int*list;
  20. Replies
    6
    Views
    1,084

    Sort array and save the new order of elements

    So I try to sort an array with qsort and then save the new order, so this means if I have a list like:

    4 3 7 2
    [0] [1] [2] [3],

    after sorting it becomes:

    2 3 4 7
    [3] [1]...
  21. Replies
    3
    Views
    810

    Check addresses on equality possible?

    I was wondering if it is possible to check if two addresses, so pointers are equal.

    I was saving the address of an array, and later wanted to identify it by the address, so if my area has the...
  22. OK i think I got your point, I will try to change...

    OK i think I got your point, I will try to change the method.

    The error I got was just an index mistake I made.. But I have more question, I run valgrind over my code, and its complaining...
  23. Ok, but don't I need one more array to save the...

    Ok, but don't I need one more array to save the new calculated values? or how do you mean it, to use two pointers, like I understood it: one for my current array, and another one in the new one where...
  24. Method to merge list entries, undefined behaviour-sometimes terminating sometimes not

    Ok, I have again a problem, and this time i will try to make a post acceptable for the readers :).

    So what I want to do: my method gets a list of structures:



    #define BOOL unsigned int...
  25. Replies
    9
    Views
    1,438

    But yes, maybe you are right, i Should split it...

    But yes, maybe you are right, i Should split it into several small methods and test step by step. So I go back to work..thanks
Results 1 to 25 of 69
Page 1 of 3 1 2 3