# I can't believe it......I found a way to multiply 2 pointers!!!!!!

• 07-02-2002
Golden Bunny
I can't believe it......I found a way to multiply 2 pointers!!!!!!
Code:

```/* Demonstrates inline and multiplying pointers */ #include <iostream> #include <windows.h> inline int ptrmult(int x, int y) {  int *ptr, *scd;  ptr= &x;  scd= &y;  return (*ptr)*(*scd); } int main(int argc, char *argv[]) {  int a, b, c;  cout << "Input a number: ";   cin >> a;  cout << "Input a number: ";   cin >> b;  c= ptrmult(a, b);  cout << a << " + " << b << "= " << c;  Sleep(c*a*b+100);  cin.get();  return 0; } /* multiplying pointers with just one function int main(int argc, char *argv[]) {  int x, y;  cin >> x >> y;  int *pointer, *second;  pointer=&x;  second= &y;  cout << (*pointer)*(*second);  cin.get();  return 0; } amazing huh? */```
To make this topic have a point, rate my coding. Tell me if I could use a better method of performing such an amazing task.
• 07-02-2002
moemen ahmed
execuse me....but i cant c here any amzing thing.all u ve done is just derefrenced the values in the int (which is totally normal thing) and mutliplying it............u didnt multiply the pointers .
or may be just i cant understand it right !!!!
• 07-03-2002
The Dog
I agree that there's nothing special 'bout it. What you actually doing is multiplying to integers and as far as i know, doing that is not one of the hardest tasks. (actually not even a task at all !)
• 07-03-2002
bljonk
hey!!! chillin man the guy just discovered that's also possible to multiply to numbers using pointers(hahaha).