User Profile

Collapse

Profile Sidebar

Collapse
sss555
sss555
Last Activity: Mar 23 '07, 02:00 AM
Joined: Mar 17 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sss555
    replied to extern with arrays of structure
    in C
    when extern storage class is called, could the arrays of structure hold multiple instances..

    Because this arrays of file1.cc hold neighbor information of nodes (time varying) and when extern is called that behavior is no more there.

    Could send 'you' the files .Thanks for your suggestions...
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    I simply require the array instances in file1.cc to be reflected in file2.cc.
    The problem I see is whenever I define extern in file1.h without even trying to retrieve from file2.cc, the values indicated in original arrays of struct go haywire....
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    Well, I want the file2.cc to be capable of accessing information maintained by arrays in file1.cc.

    i.e file1 maintains {id,val} information for each node;and file2 tries to retrieve this information.

    Thanks for your questions and suggestions....
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    What I observe is when declared as extern, it maintains a single instance hence overwrites the array, whereas otherwise it maintains multiple instances giving each value,id pair.
    If I'm to elaborate a bit:
    This i do to maintain a neighbor table that corresponds to each node, so when
    you run file2.cc alone(without extern), each node has it's own neighbor table(with corresponding id,value pair of its neighbors)

    when...
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    I managed to compile it this time, but the ultimate result is the same as I got when I declared extern struct in both the .cc files (like in my first posting)

    Thanks...
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    I still get this error while trying to compile.

    file1.h:270: error: storage class specified for ‘myList_’



    Thank you...
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    In fact I want to retrieve file1 data into file2.If I understand your code correctly it does the other way round.

    I tried this way and when I compile I get the following error

    file1.h:270: error: storage class specified for 'myList_'



    Thank you for your suggestions....
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    I'm working on Linux, and it works normally in #include<direct/file1.h> style.

    Could you explain me how could I use, extern with arrays of structure?

    Thank you...
    See more | Go to post

    Leave a comment:


  • sss555
    replied to extern with arrays of structure
    in C
    well it is not in the current directory, so i specified the path
    #include <direct/file1.h>

    Yes I tried putting extern declaration in the heade file too(file1.h).St ill doesn't work.

    Thanks for your attention....
    See more | Go to post

    Leave a comment:


  • sss555
    started a topic extern with arrays of structure
    in C

    extern with arrays of structure

    Hi,

    I tried to share some data between 2 .cc files hence declared the arrays of structure as extern in one of the .cc files.

    However I get abnormal entries in the original array entries otherwise I wouldn't have got.

    file1.h
    ---------
    struct Mylistdetails {
    int id;
    int value;
    }


    file1.cc
    ----------
    struct Mylistdetails myList_[MAX_NO];...
    See more | Go to post
No activity results to display
Show More
Working...