Post: Can someone verify this statement
02-18-2013, 01:48 AM #1
|C++|
< ^ > < ^ >
(adsbygoogle = window.adsbygoogle || []).push({}); in c++ the reason for making a function type pointer like this is so that we can initialize the return value to a pointer type. And if it was a reference "&" instead of pointer type we would be initializing the return value to reference type.

    int main(){int *gg=Function();.............}

[B][I][U]int *Function()[/U][/I][/B]
{
int x=3;
int *pointer=x;
return *pointer;
}


(im talking about the "int *Function()" part)

im just trying to solidify my understanding.
(adsbygoogle = window.adsbygoogle || []).push({});
02-27-2013, 04:00 AM #11
|C++|
< ^ > < ^ >
Originally posted by Jakes625PS3 View Post
If you want. lol.


lmao thats like a guy asking a girl for her number and she says"If you want lol".
you fucking dick.

jkjk
02-27-2013, 04:09 AM #12
Originally posted by C
lmao thats like a guy asking a girl for her number and she says"If you want lol".
you fucking dick.

jkjk


lol'd

and i dunno never been asked that before. xD

btw if you're serious about this idk if I'll have that much open time due to school, hw, NA meetings, and teen court. I got a lot of stuff on my hands.
06-26-2013, 01:12 AM #13
Originally posted by C
in c++ the reason for making a function type pointer like this is so that we can initialize the return value to a pointer type. And if it was a reference "&" instead of pointer type we would be initializing the return value to reference type.

    int main(){int *gg=Function();.............}

[B][I][U]int *Function()[/U][/I][/B]
{
int x=3;
int *pointer=x;
return *pointer;
}


(im talking about the "int *Function()" part)

im just trying to solidify my understanding.



int* gg = (int*)&Function(); ?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo