| delorie.com/archives/browse.cgi | search |
| From: | "Paul Lutus" <nospam AT nosite DOT com> |
| Newsgroups: | alt.comp.lang.learn.c-c++,comp.lang.c++,comp.os.msdos.djgpp,comp.os.msdos.programmer |
| References: | <7n6153$eqc$1 AT autumn DOT news DOT rcn DOT net> |
| Subject: | Re: Help with Casts... |
| Lines: | 67 |
| X-Newsreader: | Microsoft Outlook Express 4.72.3110.5 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3 |
| Message-ID: | <coxl3.52065$AU3.1181497@news2.giganews.com> |
| NNTP-Posting-Date: | Wed, 21 Jul 1999 23:48:08 CDT |
| Organization: | Giganews.Com - Premium News Outsourcing |
| X-Trace: | sv1-mzVPU/chhKXWQgzoW+U4SWnSvSIyP2J2WN2nm8XTwMBbbMuer2F0UUMp0Gr2PumV/Z14XxPovVmBzVD!vzGGLJoowldx |
| X-Complaints-To: | abuse AT GigaNews DOT Com |
| X-Abuse-Info: | Please be sure to forward a copy of ALL headers |
| X-Abuse-Info: | Otherwise we will be unable to process your complaint properly |
| Date: | Wed, 21 Jul 1999 21:48:06 -0700 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
<< I'm am having trouble understanding casts. >>
No, you aren't. You are having trouble understanding pointers.
<< Let's say I want to call a program >>
You mean call a function.
<< and it takes three variables. >>
You mean three arguments.
<< Two of those variables are casts and are supposed to return values from
what I understand. >>
You mean two of the three arguments are pointers and can be modified within
the function.
<< How do I get those two values. >>
"Get?" Don't you mean "set?"
I hope this answer helps -- code almost always conveys more meaning in a
newsgroup than prose:
#include <stdio.h>
void modifyMyVals(int *a,int *b)
{
*a = 3;
*b = 4;
}
int main()
{
int a = 1, b = 2;
printf("Before: %d %d\n",a,b);
modifyMyVals(&a,&b);
printf("After: %d %d\n",a,b);
return 0;
}
--
Paul Lutus
www.arachnoid.com
Tom wrote in message <7n6153$eqc$1 AT autumn DOT news DOT rcn DOT net>...
>I'm am having trouble understanding casts. Let's say I want to call a
>program and it takes three variables. Two of those variables are casts and
>are supposed to return values from what I understand. How do I get those
>two values.
>
>Example;
>
>int playcdtrack(tracknumber, *startingposition, *endingposition)
>
>How do I get the variables startingposition and endingposition of let's say
>track #1?
>
>If anyone can help I would greatly appreciate. Thanks.
>
>Tom
>
>
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |