Search:

Type: Posts; User: Saravanan

Search: Search took 0.01 seconds.

  1. Replies
    20
    Views
    8,916

    Hello hammer, Thank you for your reply. You...

    Hello hammer,
    Thank you for your reply. You seem to have used malloc and I have used calloc ... Other than that I use the same sematics you use ... the only differences I see are -->




    ...
  2. Replies
    20
    Views
    8,916

    I use two callocs ... one to allocate the space...

    I use two callocs ... one to allocate the space for the pointers that hold the actual data and one to allocate the actual data.



    for (i = 0; i < 10; i++)
    {
    pSections[i] =...
  3. Replies
    20
    Views
    8,916

    The reason I dont use what you just described is...

    The reason I dont use what you just described is because I already have all of these entries allocated as a result of other code. I just need to hold the pointers. So look at it this way -->



    ...
  4. Replies
    20
    Views
    8,916

    I am allocating space for the 2nd dimension in...

    I am allocating space for the 2nd dimension in the array and not the structure. So I think it should be sizeof(MyStruct *) ... right? Please let me know if I assume correct.
  5. Replies
    20
    Views
    8,916

    Struct *** initialization

    I am trying to allocate memory for a structure that looks like this.



    typedef struct
    {
    int nID;
    char ** pMessage;
    } MyStruct;
  6. Replies
    3
    Views
    1,121

    Hi folks, Thank you for the reply, Salem. I...

    Hi folks,
    Thank you for the reply, Salem. I have a compile problem now pertaining to the same issue. Why cant I do the following




    struct A
    {
    int a;
    A * ptr[];
  7. Replies
    3
    Views
    1,121

    Hi orbitz, Thanks for that response. ...

    Hi orbitz,
    Thanks for that response.
    Actually I am not trying to implement a linked list. There are two seperate structures (A and B are actually a whole lot different) and the idea is that...
  8. Replies
    3
    Views
    1,121

    [] intialization of arrays

    Hello all,
    I have a question about arrays of variable length. This is what I would like to do. I have two structures A and B

    struct A
    {
    int a;
    int b;
    struct A * pSubA;
    };
  9. Replies
    18
    Views
    3,168

    Folks, I think I got it ... I needed to...

    Folks,
    I think I got it ...

    I needed to place the union defenition like this -->

    struct bits
    {
    unsigned long d : 12
    unsigned long c : 12
    unsinged long b : 5
  10. Replies
    18
    Views
    3,168

    Thanks for this discussion folks. Let me restate...

    Thanks for this discussion folks. Let me restate my problem so that there is clarity.
    I want to define a structure that will retreive the meaning of the char array into member variables. The meaning...
  11. Replies
    18
    Views
    3,168

    When you say drastically change the structure, do...

    When you say drastically change the structure, do you mean the sizes also ... because I am ok to changing the structures ... This structure is local to my application. its only the char array that...
  12. Thread: Time header

    by Saravanan
    Replies
    3
    Views
    1,093

    time_t time() will give you time passed since...

    time_t time() will give you time passed since epoch which is 00:00:00 January 1 1970. To find out difference between two times, you need to create the time_t entries for both times and subtract the...
  13. Replies
    18
    Views
    3,168

    I use memcpy to copy between character arrays. I...

    I use memcpy to copy between character arrays. I dont want to use the shifting route because that will mean that I need to know size of each data type. I prefer to change the structure itself so that...
  14. Replies
    18
    Views
    3,168

    I tried this out and it works great ... thanks...

    I tried this out and it works great ... thanks ... But I have another request. Can I acheive the result to this problem without so many shifting operations by just reshuffling the order of members in...
  15. Replies
    1
    Views
    1,483

    Try using argv[1]. I am assuming that you use the...

    Try using argv[1]. I am assuming that you use the following syntax to run your command

    <your program name> filename.txt

    argv[0] will give you the name of the executable itself. That is why you...
Results 1 to 15 of 15