Basics of Pointers
#1.
#2
My question is, what's exactly the difference between shoving in a pointer (*) between "void" and "IloveC++" , and shoving in a pointer (*) between "double" and "firstpointer"?
For a better understanding...
What is the difference between this:
...and this?
@giniyat101 specially ;p
---------- Post added at 07:05 PM ---------- Previous post was at 07:04 PM ----------
EDIT: Okay forget the "system("pause")" thing I made a mistake lol.
Code:
#include <iostream>
using namespace std;
void IloveC++(double *firstpointer)
{
*firstpointer=9.95;
}
int main()
{
double x=5.342;
*secondpointer=&x;
IloveC++(secondpointer);
cin.get()
system("pause")
}
#2
Code:
#include <iostream>
using namespace std;
void *IloveC++(double firstpointer)
{
*firstpointer=9.95;
}
int main()
{
double x=5.342;
*secondpointer=&x;
IloveC++(secondpointer);
cin.get()
system("pause")
}
For a better understanding...
What is the difference between this:
Code:
void *IloveC++(double firstpointer)
Code:
void IloveC++(double *firstpointer)
---------- Post added at 07:05 PM ---------- Previous post was at 07:04 PM ----------
EDIT: Okay forget the "system("pause")" thing I made a mistake lol.

![=]](/forum/images/emotions/=].gif)