Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Closed Thread
 
Thread Tools Display Modes
Old Dec 4th, 2007, 3:02 AM   #1
dammest
Newbie
 
Join Date: Dec 2007
Posts: 2
Rep Power: 0 dammest is on a distinguished road
Try this if you can help me

Write a program that counts the number of occurrences of selected words in standard input.
Remarks:
• The selected words are given as command line parameters.
• The program should print out the words with their number of occurrences.
Use following definition:
typedef struct {
char * word;
unsigned int counter;
} wordDsc;
The program must have two functions to count the words.
1) The first one (function fixedCount) should use an array of 20 such structures. The function should use a following local array of such structures:
wordDsc fixedSizeArr[20];
2) The second one (function varCount) should use an array of variable size. The function should use the following local pointer to an array of such structures:
wordDsc *varSizeArr;
The size of the array must correspond to the actual number of words that are given by the user.
If the number of words is even use the function fixedCount in the other case use the function varCount.
Test the program using the redirection of standard input and the test.txt file.
dammest is offline  
Old Dec 4th, 2007, 3:29 AM   #2
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 532
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: Try this if you can help me

Closed because cross-post at DaniWeb.
Ancient Dragon is offline  
Closed Thread

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:10 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC