Hi,
Using void* and sizeof is it possible to get the value of the object ?
I understand that dereferencing a void pointer is not directly possible. Is there a way (like casting) or something else to get the value of the object.
The problem is I wouldn't know the type of the object to cast to, I would only know the size of the object and a void pointer to the object.
something similar to what qsort does in stdlib.h, using merely the void pointer and sizeof, I think it manages to access the object, otherwise wouldn't be able to sort it.
Below shown is an example in which inside the function f1, I am suppose to access the object.
Code: class ClassA{};//Inside f1, I have to access the value of the object that pPtr1 points tovoid f1(void* pPtr1, const int pSizeOfObj){}int main(){ ClassA objA; f1(&objA, sizeof(objA)); return(0);}Thanks,
Socket Server
In my following socket server, I am trying to listen to a connection through port 12345 in my web browser. http://127.0.0.1:12345/I assumed that the following would detect that something was trying to
Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,Its been a while, I know. Use to love coming here to answer peoples questions, but work and school have been keeping me too busy but do anything but lurk. I usually write all my code/apps by
PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?
Converting numbers to months
The porgram works -just need the last function(month_convert_ to convert numbers to months -thanks.
SQL Injection
In my attempts to protect my database from mySQL injection I have created another problem for myself....Currently all user inputted strings go through this function;Code: function cleanQuery($string)
get font info from a font file
hello,Does anyone know how to get font info from a font file ... using php of course ! The stuff I need to extract is Font Family, Author, Copyright etc which is contained as attributes in the font
b+ tree
Hi can every body help me about b+ tree ?(insert & delete)
the problem with str_replace
$str="hahahahahahahahahahahahahaha";$nn=1;$str=str_replace('ha','MyGod',$str,$nn);echo $str;the result is MyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodWhy $nn has no
PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page will use code to pull information from a database and display it on the page in a formatted way.Code:
Help uploading .JPG
I have a problem with upload images when the ending is .JPG capitalized.. I really don't know what causes it to crash but been testing it for some time and it's my retrictions that won't allow it in.