User Profile

Collapse

Profile Sidebar

Collapse
Seisouhen
Seisouhen
Last Activity: Apr 19 '08, 11:58 PM
Joined: Mar 31 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Seisouhen
    started a topic Using mmap to assign space for a struct
    in C

    Using mmap to assign space for a struct

    Hi all,
    I am using mmap to obtain some space(mapped anonymously) and am giving the address of the assigned space to a struct pointer. Then I want to access a member of the struct that the pointer points to. The code is:

    //----begin
    struct foo{
    int test;
    }foo;

    struct foo one,*one_ptr;
    one_ptr=mmap(NU LL,sizeof(one), PROT_READ|PROT_ WRITE,MAP_ANON,-1,0);
    *one_ptr = one;...
    See more | Go to post
    Last edited by Seisouhen; Apr 19 '08, 11:49 PM. Reason: incomplete post

  • Seisouhen
    replied to iterator problem
    in C
    Thanx gpraghuram,
    Well, the problem was that I was trying to access retn_name in iter but lo and behold iter is a pointer and it doesn't have retn_name. What iter points to has the function so I changed the iter in line 241 to (*iter) -> retn_name and everything is fine. By fine I mean it compiles, it still doesn't do what I want it to.

    Anyway, thanx to everyone for helping sp. gpraghuram....
    See more | Go to post

    Leave a comment:


  • Seisouhen
    replied to iterator problem
    in C
    forgot to mention:
    line 340 condition = srch_list(listS Li, name_stq);//which calls the function

    ~code~

    template <class type>
    string srch_list(std:: list <type> &list_name, std::string srch_name)
    {
    string condition;
    typename list<type>::con st_iterator iter;
    for(iter = list_name.begin (); iter != list_name.end() ; iter++)
    {
    linen 241 if (iter->retn_name()...
    See more | Go to post

    Leave a comment:


  • Seisouhen
    replied to iterator problem
    in C
    I changed the above snippet of code to

    template <class type>
    string srch_list(std:: list <type> &list_name, std::string srch_name)
    {
    string condition;
    typename list<type>::con st_iterator iter;
    for(iter = list_name.begin (); iter != list_name.end() ; iter++)
    {
    if (iter->retn_name() == srch_name)
    condition = "true";
    }
    return...
    See more | Go to post

    Leave a comment:


  • Seisouhen
    replied to iterator problem
    in C
    I changed the iterator to

    template <class type> string srch_list(list <type> &list_name, std::string srch_name)
    {
    string condition;
    typename list<type>::con st_iterator iter;
    for(iter = (*list_name).be gin(); iter != (*list_name).en d(); iter++)
    {
    if ((*list_name)->retn_name() == srch_name)
    condition = "true";
    }
    return condition;...
    See more | Go to post

    Leave a comment:


  • Seisouhen
    started a topic iterator problem
    in C

    iterator problem

    Hi everyone,
    I am a newbie to C++ programming and am running into iterator problems..here are the snippets and the error:

    //First, I have a template class called SimpleList that provides linked list functionality with functions like push, pop etc..The idea is to create stack, queues of diff. types (like char, int etc.)
    ~~bunch of code in between~


    //function to search a list for a particular...
    See more | Go to post
No activity results to display
Show More
Working...