it worked fine.But when I did this for many void* in a loop
it returns segmentation fault.
Dont know what code is inside fun but you cant dereference a void*...besides a[i] is a void* not void** so definition of fun needs to change to "void fun(void *b) {...}"
First and foremost, this is not a homework for your information. I'm just new to using c-shell programming and I just wanted to make my life easier @ work.
Say, the file contains the following:
ID FILE NO. SL VP
1 1 22 33
1 2 ... (3 Replies)
Hello all
im trying to build function that will return void function pointer
what is mean is ( not working )
the main function
void * myClass::getFunction(int type){
if(type==1)
return &myClass::Test1;
if(type==2)
return &myClass::Test2;
}
void myClass::Test1(){... (1 Reply)
What is the difference between f(...) , f(void),f()
I know that f(void) doesn't take any parameters, but what about f() and f(...) Does the last call of function even exists? (2 Replies)
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
I have two or more linked lists that have the same names for their "next". For example,
struct server_t {
sockaddr_in * sin;
server_t * next_;
}
struct player_t {
char name;
player_t * next_;
}
How can I get a function to take in either type and manipulate the pointers?
I... (3 Replies)
i am trying to convert void pointer to pthread_t on hpux-itanium 64 bit which fails as below
"src/file.cpp", line 88: error #2171: invalid type conversion
pthread_t tid = reinterpret_cast<pthread_t>(m_threadId);
1 error detected in the compilation of "src/file.cpp"
... (0 Replies)
I have a function to which I will pass a struct ID and it will return me a string.
I will pass a pointer to store the name string and that pointer will be allocated memory by the function called.
int ConvertIDToName(void *id, void *name, size_t *size)
{
int status = 0;
... (5 Replies)
Discussion started by: rupeshkp728
5 Replies
LEARN ABOUT PHP
spldoublylinkedlist
SPLDOUBLYLINKEDLIST(3) 1 SPLDOUBLYLINKEDLIST(3)The SplDoublyLinkedList classINTRODUCTION
The SplDoublyLinkedList class provides the main functionalities of a doubly linked list.
CLASS SYNOPSIS
SplDoublyLinkedList
SplDoublyLinkedListIteratorArrayAccessCountable
Methods
o public SplDoublyLinkedList::__construct (void )
o public void SplDoublyLinkedList::add (mixed $index, mixed $newval)
o public mixed SplDoublyLinkedList::bottom (void )
o public int SplDoublyLinkedList::count (void )
o public mixed SplDoublyLinkedList::current (void )
o public int SplDoublyLinkedList::getIteratorMode (void )
o public bool SplDoublyLinkedList::isEmpty (void )
o public mixed SplDoublyLinkedList::key (void )
o public void SplDoublyLinkedList::next (void )
o public bool SplDoublyLinkedList::offsetExists (mixed $index)
o public mixed SplDoublyLinkedList::offsetGet (mixed $index)
o public void SplDoublyLinkedList::offsetSet (mixed $index, mixed $newval)
o public void SplDoublyLinkedList::offsetUnset (mixed $index)
o public mixed SplDoublyLinkedList::pop (void )
o public void SplDoublyLinkedList::prev (void )
o public void SplDoublyLinkedList::push (mixed $value)
o public void SplDoublyLinkedList::rewind (void )
o public string SplDoublyLinkedList::serialize (void )
o public void SplDoublyLinkedList::setIteratorMode (int $mode)
o public mixed SplDoublyLinkedList::shift (void )
o public mixed SplDoublyLinkedList::top (void )
o public void SplDoublyLinkedList::unserialize (string $serialized)
o public void SplDoublyLinkedList::unshift (mixed $value)
o public bool SplDoublyLinkedList::valid (void )
PHP Documentation Group SPLDOUBLYLINKEDLIST(3)