Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 22nd, 2002, 08:30 AM
Jude Deery Jude Deery is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Eire
Posts: 1 Jude Deery User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrays

Hello,
I'm fighting a losing battle with the following program construct. It is part of a college assignment and I would greatly appreciate any help you good people out there may be able to give. The language is C and this is the conundrum:

Construct a program that will create an array of names and dates of birth. The user will then be able to type in the name of a person and the array will be searched for that name. If a match is found the date of birth for that person is displayed.

I cannot seem to get good form in documenting the correct code layout. My scenario is that I want to use 6 names and 6 dates of birth so that when I type in, for example "John Huston" and hit the return key, his DOB will be displayed. I have included my effort so far using just the one piece of data to give an idea of how I'm going about coding the program. I'm working with the Miracle C Compiler.Hope someone somewhere can help,
Thank you,
Jude

/*Program to create records,
store them in an array and search the
array for the name and display
the result*/


#include <stdio.h>


main()
{

struct persons_rec /*structure template*/
struct date
{
char surname [7];
char first_name [6];
int date [8];
/*Define structure variable and initialize it with some values*/
struct persons_rec persons = {"Huston"};
struct first_name = {"John"};
{
struct date = {12/1/57};
{

printf ("Surname in persons is %s", surname);
printf ("First name in persons is %s", first_name);
printf ("Date in date is %d",& date);
}

Last edited by Jude Deery : June 22nd, 2002 at 09:15 AM.

Reply With Quote
  #2  
Old June 22nd, 2002, 08:46 AM
csmall csmall is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Pittsburgh, PA
Posts: 54 csmall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
What programming language are you working in?

Reply With Quote
  #3  
Old June 22nd, 2002, 08:50 AM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,632 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 12 m 33 sec
Reputation Power: 76
Send a message via AIM to Hero Zzyzzx
And what code do you have so far?

Folks aren't going to do your homework for you, but if you put up what you've tried they will be willing to help you work through it. . .

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Arrays


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway