مرحبا يااخوان ..
بالصراحه الـ ستراكت struct .. ماني عارف شنو فايدته بالاساس وهذا خلاني مااعرف شلون طريقة عمله .. :(
ونفس الشي للثابت الـ #define
بارك الله فيكم.. واتمنى الافاده لاهنتم اخواني..
اخوكم.
تم الارسال 08/09/2005 - 10:29 PM
تم الارسال 08/09/2005 - 10:59 PM
تم الارسال 09/09/2005 - 12:15 AM
تم الارسال 09/09/2005 - 12:58 AM
تم تعديل هذه المشاركة بواسطةibn_als3odiah: 09/09/2005 - 01:01 AM
تم الارسال 09/09/2005 - 03:05 AM
تم الارسال 09/09/2005 - 05:40 AM
struct Employee {
int age;
int salary;
int Childrens;
};void main()
{
Employee ahmed;
ahmed.age=20;
ahmed.Childrens=3;
ahmed.salary= 3000;
cout << ahmed.age << endl;
cout << ahmed.Childrens << endl;
cout << ahmed.salary << endl;
}
تم الارسال 09/09/2005 - 06:08 AM
تم الارسال 09/09/2005 - 10:52 AM
تم الارسال 09/09/2005 - 10:57 AM
تم الارسال 09/09/2005 - 10:59 AM
تم تعديل هذه المشاركة بواسطةMsH3AL: 09/09/2005 - 11:01 AM
تم الارسال 09/09/2005 - 11:11 AM
#ifndef ThisFile #define ThisFile
تم تعديل هذه المشاركة بواسطةahmed_3d: 09/09/2005 - 11:31 AM
تم الارسال 09/09/2005 - 11:18 AM
Quote
تم الارسال 10/09/2005 - 04:45 AM
تم الارسال 10/09/2005 - 04:58 AM
Employee ahmed; ahmed.age = ........ //etc Employee mohannad; mohannad.age = .... //etc
Quote
تم الارسال 10/09/2005 - 10:59 AM
Quote
تم تعديل هذه المشاركة بواسطةMsH3AL: 10/09/2005 - 11:01 AM
تم الارسال 10/09/2005 - 11:28 AM
const int x=12;
تم الارسال 10/09/2005 - 01:52 PM
// Return a copy of a structure
#include<stdio.h>
#include<string.h>
struct Employee {
int id;
char name[20];
};
typedef struct Employee EMP;
EMP pass_struct_addr(EMP *emp,char s[20]){
for(int i=0;i<3;i++,emp++)
if (strcmp(emp->name,s)==0)
return *emp;
}
void main(){
EMP emp[3]={123,"NORAN",456,"JAFFER",789,"AZHAR"};
EMP temp;
char s[20];
printf("Enter one of these employees ");
for(int i=0;i<3;i++)
printf("\n %s",emp[i].name);
printf("\n\n");
gets(s);
temp=pass_struct_addr(emp,strupr(s));
printf("%s id is %d",temp.name,temp.id);
}/* program to update the time by one second */
//This program converts the month that the user enter to days.
#include<stdio.h>
/* program to update the time by one second */
#include<stdio.h>
struct time
{
int hour;
int minutes;
int seconds;
};
typedef struct time TIME;
main ()
{
TIME time_update (TIME now);
TIME current_time, next_time;
printf ("enter the time (hh:mm:ss): ");
scanf ("%i:%i:%i", ¤t_time.hour,
¤t_time.minutes, ¤t_time.seconds);
next_time = time_update (current_time);
printf ("update time is %.2i:%.2i:%.2i\n", next_time.hour,
next_time.minutes, next_time.seconds );
}
/* function to update the time by one second */
TIME time_update (TIME now)
{
++now.seconds;
if (now.seconds == 60)
{ /*next minutes*/
now.seconds = 0;
++now.minutes;
if (now.minutes == 60)
{ /*next hour*/
now.minutes = 0;
++now.hour;
if ( now.hour == 24 )
now.hour = 0; /* midnight*/
}
}
return (now);
}
تم الارسال 11/09/2005 - 04:06 AM
تم تعديل هذه المشاركة بواسطةMsH3AL: 11/09/2005 - 04:07 AM
|
|