Velocity Reviews

Velocity Reviews (
-   C Programming (
-   -   clarificaiton with pointers (

satya123 02-15-2012 02:56 AM

clarificaiton with pointers
Hi all,

I was wondering whether the following code is proper i want to modify the values of a and b

#include <stdio.h>

void modify(int &, int &);

int main(int argc, char *argv[])
int a=12;
int b=13;

modify(&a, &b);

void modify(int &p, int &q)
int *f1, *f2;
*f1 = 21;
*f2 = 31;

Is it possible to pass the address parameters like the one i have shown? i know it is mistake and we need to give pointers to actually make it work? but why the above code does not work?

thanks in advance,


All times are GMT. The time now is 04:55 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.