26-01-2008, 14:51
|
|
|
חבר מתאריך: 02.06.03
הודעות: 1,224
|
|
שאלה עם pointer בC
אני חושב שיש לי בעייה בהגדרות הבסיסיות איך פוינטר עובד כי תמיד אני מקבל את ההודעה הבאה
rror C2440: '=' : cannot convert from 'int' to 'int *'
מה שאני רוצה לעשות זה לקחת מספר לחלק אותו ושהפוינטר יצביע על התוצאה
קוד:
void ConvertTimeToHM (int time, int *hours, int *min)
{
int a,b;
a=time/60; /* give hours */
b=time%60; /* give min */
hours=a;
min=b;
אז למה לא נותן לי ?
_____________________________________
It is nice to be importent but it's more importent to be nice
|