Program using structs - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > Other Programming - Perl, C++, Java, ASP, .NET Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-12-2010, 01:26 AM   #1 (permalink)
Junior Member
 
Join Date: Jan 2010
Posts: 3
Default Program using structs

Help in me designing my little project ....
i don't knw wht to do with this

Write a program that declares a struct Employee. Employee contains following
data members:
char fName[20] // contains first name of the employee
char lName[20] // contains last name of the employee
int bYear; // contains year of birth of the employee. Value range: 1950 to 1990
char bMonth[4] // contains month of birth of the employee e.g. JAN, JUL, DEC
int bDay // contains date (day) birth of the employee. Value range: 1-31
int jYear; // contains joining year of employee. Value range: 1950 to 2009
char jMonth[4] // contains joining month of employee e.g. JAN, FEB, JUN, DEC
int jDay // contains joining date (day) of employee. Value range: 1-31
long salary // contains salary of the employee. Value Range 10000-100000

Define following functions:
1- initEmployee(……) that initializes an object of Employee. (No user Defined Values
here)
2- viewEmployee(…..) that displays all the data members of an object of Employee.
3- addEmployee(…..) that takes values from user and stores it in an object of
Employee.
4-main() that contains following instructions:
Code:
void main()
{
Employee emp;
initEmployee(emp);
viewEmployee(emp);
addEmployee(emp);
viewEmployee(emp);
getch();
}

Last edited by jackprw1; 01-13-2010 at 06:27 AM.
jackprw1 is offline   Reply With Quote
Sponsored Links
Old 12-17-2010, 10:11 AM   #2 (permalink)
Junior Member
 
Join Date: Dec 2010
Posts: 10
Default Re: Program using structs

what the problem/error in this program, its look ok for me..
mindblaster is offline   Reply With Quote
Old 03-14-2011, 11:08 AM   #3 (permalink)
Junior Member
 
johnmartin's Avatar
 
Join Date: Mar 2011
Location: London
Posts: 20
Default Re: Program using structs

A data structure, especially one that serves to group a number of fields (in contrast to an object-oriented class with methods) or one that is passed by value rather than by reference.
software consultant
johnmartin is offline   Reply With Quote
Old 08-20-2011, 05:06 AM   #4 (permalink)
Junior Member
 
EZGoldExchange's Avatar
 
Join Date: Jun 2011
Location: Austin, Texas
Posts: 32
Default Re: Program using structs

why we use struts when there is jsp in java?
EZGoldExchange is offline   Reply With Quote
Old 09-04-2011, 12:26 AM   #5 (permalink)
Junior Member
 
Join Date: Sep 2011
Location: Long Islanf, NY, USA
Posts: 33
Default Re: Program using structs

Did you learn what a struct is, how you define one and how you use one?
Rukbat is offline   Reply With Quote
Old 10-20-2011, 01:33 AM   #6 (permalink)
Regular User
 
petsimcox002's Avatar
 
Join Date: Aug 2011
Location: Pasadena, CA
Posts: 195
Default Re: Program using structs

The data structure, especially one that serves to group a number of fields (in contrast to the methods of class Object), or that is above the reference value.
petsimcox002 is offline   Reply With Quote
Old 10-24-2011, 04:34 AM   #7 (permalink)
Regular User
 
Join Date: Aug 2011
Posts: 26
Default Re: Program using structs

Struct describes a value type in the C# language. Structs can improve speed and memory usage. They cannot be used in the same way as classes. Collections of structs are allocated together.

struct database {
int id_number;
int age;
float salary;
};

int main()
{
database employee; //There is now an employee variable that has modifiable
// variables inside it.
employee.age = 22;
employee.id_number = 1;
employee.salary = 12000.21;
}

mobile application software
indiansareedesigns is offline   Reply With Quote
Old 11-12-2011, 12:09 AM   #8 (permalink)
Regular User
 
Join Date: Aug 2011
Posts: 26
Default Re: Program using structs

struct S
{
int _x;
public int X
{
get { return _x; }
set
{
if (value < 10)
{
_x = value;
}
}
}
};
Struct describes a value type in the C# language. Structs can improve speed and memory usage. They cannot be used in the same way as classes. Collections of structs are allocated together.

mobile web development

iphone game apps
indiansareedesigns is offline   Reply With Quote
Old 12-28-2011, 04:07 AM   #9 (permalink)
Regular User
 
Join Date: Dec 2011
Posts: 17
Default Re: Program using structs

hello
If any one know in more about this topic then please tell me bacause this will help me.
Thanks
Regards
iconweb
iconweb is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:00 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting