Search Results

Search found 5 results on 1 pages for 'srikfreak'.

Page 1/1 | 1 

  • Garbage collection in Perl

    - by srikfreak
    Unlike Java, Perl uses reference count for garbage collection. I have tried searching some previous questions which speak about C++ RAII and smart pointers and Java GC but have not understood how Perl deals with the circular referencing problem. Can anyone explain how Perl's garbage collector deals with circular references? Is there any way to reclaim circular referenced memory which are no longer used by the program or does Perl just ignores this problem altogether?

    Read the article

  • How to use mmap to point to STL type?

    - by srikfreak
    I have a mmap typecast to a char pointer char *ptr; ptr = (char *)mmap(0, FILESIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); This was my earlier code. But now I want to use a map instead of char * as the requirements changed. Now, my map is declared as map i_s_map; How do I change my mmap call to point to the map?

    Read the article

  • Generate 10-digit number using a phone keypad

    - by srikfreak
    Given a phone keypad as shown below: 1 2 3 4 5 6 7 8 9 0 How many different 10-digit numbers can be formed starting from 1? The constraint is that the movement from 1 digit to the next is similar to the movement of the Knight in a chess game. For eg. if we are at 1 then the next digit can be either 6 or 8 if we are at 6 then the next digit can be 1, 7 or 0. Repetition of digits are allowed - 1616161616 is a valid number. Is there a polynomial time algorithm which solves this problem? The problem requires us to just give the count of 10-digit numbers and not necessarily list the numbers.

    Read the article

  • What are pointers to class members used for?

    - by srikfreak
    I have read about pointers to class members, but I have never seen them being used in any practical applications. Can someone explain what are the use cases of such pointers? Is it really necessary to have such pointers? Eg. class abc { public: int a; abc(int val) { a = val; } }; int main { int abc::*data; abc obj(5); data = &abc::a; cout << "Value of a is " << obj.*data << endl; return 0; } In the above eg. why is the value of 'a' accessed in this manner? What is the advantage of using pointers to class members?

    Read the article

  • C++ standard thread class?

    - by srikfreak
    I have come across many ad hoc implementations of thread class in C++, but why is there no standard library thread class like the one in Java? The one that I generally use in C++ is http://www.linuxdocs.org/HOWTOs/C++Programming-HOWTO-24.html

    Read the article

1