473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Structures/word counting

I have to write a program that reads in a text file word by word and calculates how many times each word appears in the file.

* I have to use dynamic array of pointers to structures to accumulate the word count (my initial thought is to take the entire file, exclude all punctuation and whitespace, and take each word and put it into an array)

* I can't include punctuation as part of the word, if I have a word like "hello!" it should be put into the array as just "hello".

I'm stuck on the whole project as to where to start. I've played around with ispunct() and also with the idea of using an if statement to compare each character with its ascii value and if it falls into the digit value or punctuation value. I just don't know where to start. Any help would be appreciated.
May 1 '06 #1
0 2084

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Clifford W. Racz | last post by:
Has anyone solved the issue of translating lists in Word 2003 (WordML) into xHTML? I have been trying to get the nested table code for my XSLT to work for a while now, with no way to get the...
4
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system...
1
by: NewAlias | last post by:
I still can't make APIs with structures to work at first time in VB .NET This is a required function to be called prior to use ScriptStringOut to display unicode complex scripts The famigerate...
4
by: McKool | last post by:
Hello everybody. I have a problem importing a function from a Dll. This dll was made in C++. I get in troubles when I try to use the following function: Function DLL DWORD __stdcall...
10
by: dbz | last post by:
Hello everyone. I have a query. Lets say that following is given:- struct struct1{ char *word; int n; } *p; QUERIES: What does the following refer to?
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
44
by: svata | last post by:
Hello, I wonder how to resize such array of structures using realloc()? #include <stdio.h> #include <stdlib.h> #define FIRST 7 typedef struct { char *name;
3
by: arnuld | last post by:
this is an example programme that counts lines, words and characters. i have noticed one thing that this programme counts space, a newline and a tab as a character. i know: 1. a newline is...
9
by: George | last post by:
C with 2 sprained hands. I would nlike to emulate the t4 encoding scheme using the following graphic: * * * * * * ***** o O o o
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.