Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <string.h> //Fica o strcpy;
- using namespace std;
- // student name Naelson c/c++ advanced !
- // Date 2016/12/08
- int main(){
- //void* pointer for any type of variable!
- //Exemple
- int x=10;
- float y=1.2;
- double w=254.657; // Variable pre defined
- char x1 [] = "Jambax64";
- void* ptrAll;
- ptrAll = & x,y,w;
- // Use a casting with asterisk. following of pointer declared in start of line.
- cout<<*(int *)ptrAll<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement