Need Help, Can you find the error??? 
November 22nd, 2005, 04:17 AM
| | | |
Hi!
now on the chapter "string-class" My assignment is below Word Counter:
Write a function that accepts a pointer to a C-String as an argument
and returns the number of words contained in the string. For instance,
if the string argument is "Four score and seven years ago" the function
should return the number 6. Demonstrate the function in a program that
asks the user to input a string and then passes it to the function. The
number of words
in the string should be displayed on the screen.It should also display
the average number of letters in each word.
Here is the begining of my program
I am getting two errors: LNK2001: unresolved external symbol "char
__cdecl wordCount(char)" (?wordCount@@YADD@Z)
Debug/1.exe : fatal error LNK1120: 1 unresolved externals
---------------------------------------------------------------------------*-----------------
#include <iostream>
#include <string>
#include <iomanip>
#include <ctype.h>
using namespace std;
char wordCount(char );
int main()
{
char cstring[81];
cout << "\nEnter a string, 80 or fewer characters:\n";
cin.getline(cstring, 81);
cout << "\nThe number of words in that string: ";
cout << wordCount(cstring[81]) << endl;
return 0;
}
char wordCount(char cstring[81])
{
int index = 0;
int word = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
index++;
}
}
if (isalnum(cstring[index]))
{
word++; //we must be in a word
while(islower(cstring[index]))
{
word++;
}
}
index++;
}
return cstring[word];
}
---------------------------------------------------------------------------*
can anyone find the error and perhaps make a suggestion to fix it.
------
Ash | 
November 22nd, 2005, 04:17 AM
| | | | re: Need Help, Can you find the error???
<ashmangat@yahoo.com> wrote in message
news:1132538520.388498.160620@o13g2000cwo.googlegr oups.com...
Hi!
now on the chapter "string-class" My assignment is below Word Counter:
Write a function that accepts a pointer to a C-String as an argument
and returns the number of words contained in the string. For instance,
if the string argument is "Four score and seven years ago" the function
should return the number 6. Demonstrate the function in a program that
asks the user to input a string and then passes it to the function. The
number of words
in the string should be displayed on the screen.It should also display
the average number of letters in each word.
Here is the begining of my program
I am getting two errors: LNK2001: unresolved external symbol "char
__cdecl wordCount(char)" (?wordCount@@YADD@Z)
Debug/1.exe : fatal error LNK1120: 1 unresolved externals
---------------------------------------------------------------------------*-----------------
#include <iostream>
#include <string>
#include <iomanip>
#include <ctype.h>
using namespace std;
char wordCount(char );
*** Here you're declaring a function accepting a single character as a
parameter
*** Fix this to match your actual function below.
int main()
{
char cstring[81];
cout << "\nEnter a string, 80 or fewer characters:\n";
cin.getline(cstring, 81);
cout << "\nThe number of words in that string: ";
cout << wordCount(cstring[81]) << endl;
return 0;
}
char wordCount(char cstring[81])
*** Here you're declaring a function accepting an array of 81 characters as
a parameter
{
int index = 0;
int word = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
index++;
}
}
if (isalnum(cstring[index]))
{
word++; //we must be in a word
while(islower(cstring[index]))
{
word++;
}
}
index++;
}
return cstring[word];
} | 
November 22nd, 2005, 04:17 AM
| | | | re: Need Help, Can you find the error???
"Jim Langston" <tazmaster@rocketmail.com> wrote in message
news:z6agf.38031$7s1.24424@fe04.lga...[color=blue]
> <ashmangat@yahoo.com> wrote in message
> news:1132538520.388498.160620@o13g2000cwo.googlegr oups.com...
> Hi!
> now on the chapter "string-class" My assignment is below Word Counter:
> Write a function that accepts a pointer to a C-String as an argument
> and returns the number of words contained in the string. For instance,
> if the string argument is "Four score and seven years ago" the function
> should return the number 6. Demonstrate the function in a program that
> asks the user to input a string and then passes it to the function. The
> number of words
> in the string should be displayed on the screen.It should also display
> the average number of letters in each word.
> Here is the begining of my program
> I am getting two errors: LNK2001: unresolved external symbol "char
> __cdecl wordCount(char)" (?wordCount@@YADD@Z)
> Debug/1.exe : fatal error LNK1120: 1 unresolved externals
> ---------------------------------------------------------------------------*-----------------
> #include <iostream>
> #include <string>
> #include <iomanip>
> #include <ctype.h>
> using namespace std;
> char wordCount(char );
>
> *** Here you're declaring a function accepting a single character as a
> parameter
> *** Fix this to match your actual function below.
>
> int main()
> {
> char cstring[81];
>
>
> cout << "\nEnter a string, 80 or fewer characters:\n";
> cin.getline(cstring, 81);
> cout << "\nThe number of words in that string: ";
> cout << wordCount(cstring[81]) << endl;[/color]
*** Also, here, why aren't you calling wordCount(cstring) ?
[color=blue]
> return 0;
>
>
> }
>
>
> char wordCount(char cstring[81])
> *** Here you're declaring a function accepting an array of 81 characters
> as a parameter
> {
> int index = 0;
> int word = 0;
> while (cstring[index] != '\0')
> {
> if (isspace(cstring[index]))
> {
> while (isspace(cstring[index]))
> {
> index++;
> }
> }
> if (isalnum(cstring[index]))
> {
> word++; //we must be in a word
> while(islower(cstring[index]))
> {
> word++;
> }
> }
> index++;
> }
> return cstring[word];[/color]
*** What are you trying to return here? Doen't you actually want to return
the number of words? I think your function needs work.
[color=blue]
>
> }
>
>[/color] | 
November 22nd, 2005, 04:17 AM
| | | | re: Need Help, Can you find the error???
no error this time but when it excutes, i'm asked to input a string.
but it stops after the line number of words.
#include <iostream>
#include <string>
#include <iomanip>
#include <ctype.h>
using namespace std;
char wordCount(char []);
int main()
{
char cstring[81];
int index = 0;
cout << "Written by Arshdeep Kaur, Cs102 online\n";
cout << "\nEnter a string, 80 or fewer characters:\n";
cin.getline(cstring, 81);
cout << "\nThe number of words in that string: ";
wordCount(cstring);
cout << index << endl;
return 0;
}
char wordCount(char cstring[])
{
int index = 0;
int word = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
index++;
}
}
if (isalnum(cstring[index]))
{
word++;
while(islower(cstring[index]))
{
word++;
}
while((isalnum(cstring[index])) || ( ispunct(cstring[index])))
{
word++;
}
}
index++;
return index;
}
}
I think there is a problem in my wordCount funtion | 
November 22nd, 2005, 04:17 AM
| | | | re: Need Help, Can you find the error???
<ashmangat@yahoo.com> wrote in message
news:1132549158.209292.114750@g43g2000cwa.googlegr oups.com...[color=blue]
> no error this time but when it excutes, i'm asked to input a string.
> but it stops after the line number of words.
> #include <iostream>
> #include <string>
> #include <iomanip>
> #include <ctype.h>
> using namespace std;
> char wordCount(char []);
> int main()
> {
> char cstring[81];
> int index = 0;
> cout << "Written by Arshdeep Kaur, Cs102 online\n";
> cout << "\nEnter a string, 80 or fewer characters:\n";
> cin.getline(cstring, 81);
> cout << "\nThe number of words in that string: ";
> wordCount(cstring);
> cout << index << endl;
> return 0;
> }
> char wordCount(char cstring[])
> {
> int index = 0;
> int word = 0;
> while (cstring[index] != '\0')
> {
> if (isspace(cstring[index]))
> {
> while (isspace(cstring[index]))
> {
> index++;
> }
> }[/color]
*** Okay, here you're saying skip over any white space.
[color=blue]
> if (isalnum(cstring[index]))
> {
> word++;[/color]
*** Okay, you skipped over white space, have hit a character so words is
increased.[color=blue]
> while(islower(cstring[index]))
> {
> word++;[/color]
*** Ooops, why are you increasing words for characters? Don't you want to
skip over
*** the rest of the characters in the word? Wouldn't that be index++ ?[color=blue]
> }
> while((isalnum(cstring[index])) || ( ispunct(cstring[index])))
> {
> word++;[/color]
*** Same here[color=blue]
> }
> }
> index++;
> return index;[/color]
Why are you returning index? Don't you mean to return word?[color=blue]
> }
>
> }
> I think there is a problem in my wordCount funtion
>[/color] | 
November 22nd, 2005, 04:17 AM
| | | | re: Need Help, Can you find the error???
Jim Langston wrote:[color=blue]
> <ashmangat@yahoo.com> wrote in message
> news:1132549158.209292.114750@g43g2000cwa.googlegr oups.com...[color=green]
>> no error this time but when it excutes, i'm asked to input a string.
>> but it stops after the line number of words.[/color][/color]
(All comments are for ashmangat)
There is also an error in main:
[color=blue][color=green]
>> #include <iostream>
>> #include <string>
>> #include <iomanip>
>> #include <ctype.h>
>> using namespace std;
>> char wordCount(char []);
>> int main()
>> {
>> char cstring[81];
>> int index = 0;
>> cout << "Written by Arshdeep Kaur, Cs102 online\n";
>> cout << "\nEnter a string, 80 or fewer characters:\n";
>> cin.getline(cstring, 81);
>> cout << "\nThe number of words in that string: ";
>> wordCount(cstring);[/color][/color]
^^^^
This should be: index = wordCount(cstring);
The way you do it you just ignore the result of wordCount.
[color=blue][color=green]
>> cout << index << endl;[/color][/color]
If you don't want/need to save the result of wordCount, you could also write
cout << wordCount(cstring) << endl;
instead of the line above, and remove all lines containing index in main.
[color=blue][color=green]
>> return 0;
>> }[/color][/color]
Note: Just to be clear, index in main and index in wordCount are two
seperate variables, even though they share the name.
Read up on variable scope.
HTH
Fabio | 
November 22nd, 2005, 04:18 AM
| | | | re: Need Help, Can you find the error???
Yay it works
Here is the working code
#include <iostream>
#include <string>
#include <iomanip>
#include <ctype.h>
using namespace std;
int wordCount(char []);
int main()
{
char cstring[81];
int index ;
cout << "Written by Arshdeep Kaur, Cs102 online\n";
cout << "\nEnter a string, 80 or fewer characters:\n";
cin.getline(cstring, 81);
cout << "\nThe number of words in that string: ";
index = wordCount(cstring);
cout << index << endl;
return 0;
}
int wordCount(char cstring[])
{
int index = 0;
int word = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
index++;
}
}
if (isalnum(cstring[index]))
{
word++;
while(islower(cstring[index]))
{
index++;
}
while((isalnum(cstring[index])) || ( ispunct(cstring[index])))
{
index++;
}
}
index++;
}
return word;
}
***Now I just need to find the average number in each word, haven't yet
figured out how to do that.
Thanks
---------
Ash | 
November 22nd, 2005, 04:18 AM
| | | | re: Need Help, Can you find the error???
#include <iostream>
#include <string>
#include <iomanip>
#include <ctype.h>
#include <stdlib.h>
using namespace std;
void avgg(char[]);
int wordCount(char []);
int main()
{
char cstring[81];
int index;
cout << "Written by Arshdeep Kaur, Cs102 online\n";
cout << "\nEnter a string, 80 or fewer characters:\n";
cin.getline(cstring, 81);
cout << "\nThe number of words in that string: ";
index = wordCount(cstring);
cout << index << endl;
avgg(cstring);
return 0;
}
int wordCount(char cstring[])
{
int index = 0;
int word = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
index++;
}
}
if (isalnum(cstring[index]))
{
word++;
while(islower(cstring[index]))
{
index++;
}
while((isalnum(cstring[index])) || ( ispunct(cstring[index])))
{
index++;
}
}
index++;
}
return word;
}
void avgg( char cstring[])
{
int index = 0;
float avg = 0.0;
int word = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
word++;
}
}
if (isalnum(cstring[index]))
{
word++;
while(islower(cstring[index]))
{
index++;
}
while((isalnum(cstring[index])) || ( ispunct(cstring[index])))
{
index++;
}
}
index++;
}
float Total = 0.0;
Total += word;
avg = (Total / index);
cout << "Average: " << fixed << showpoint << setprecision(2) << avg
<< endl;
}
****I am getting avg like 0.02, 0.04
****Can anyone figure out the problem | 
November 22nd, 2005, 08:35 AM
| | | | re: Need Help, Can you find the error???
<ashmangat@yahoo.com> wrote in message
news:1132624624.524549.165920@o13g2000cwo.googlegr oups.com...[color=blue]
> #include <iostream>
> #include <string>
> #include <iomanip>
> #include <ctype.h>
> #include <stdlib.h>
> using namespace std;
> void avgg(char[]);
> int wordCount(char []);
> int main()
> {
> char cstring[81];
> int index;
> cout << "Written by Arshdeep Kaur, Cs102 online\n";
> cout << "\nEnter a string, 80 or fewer characters:\n";
> cin.getline(cstring, 81);
> cout << "\nThe number of words in that string: ";
> index = wordCount(cstring);
> cout << index << endl;
> avgg(cstring);
>
> return 0;
> }
> int wordCount(char cstring[])
> {
> int index = 0;
> int word = 0;
> while (cstring[index] != '\0')
> {
> if (isspace(cstring[index]))
> {[/color]
** This if is totally unneccesary. If it isn't a space the while will never
** be executed. Get rid of the if (isspace(... and just keep the while
(isspace(...
[color=blue]
> while (isspace(cstring[index]))
> {
> index++;
> }
> }
> if (isalnum(cstring[index]))
> {
> word++;
> while(islower(cstring[index]))
> {
> index++;
> }[/color]
** Why are you passing over lowercase chars? Won't the isalnum also pass
them over?
** I believe you can get rid of the while(islower(... altogether
[color=blue]
> while((isalnum(cstring[index])) || ( ispunct(cstring[index])))
> {
> index++;
> }
> }
> index++;
> }
> return word;
> }
> void avgg( char cstring[])
> {
> int index = 0;
> float avg = 0.0;
> int word = 0;
> while (cstring[index] != '\0')
> {
> if (isspace(cstring[index]))
> {[/color]
** Same as in previous funcion[color=blue]
> while (isspace(cstring[index]))
> {
> word++;[/color]
** Are you sure you want to do this? Why are you increasing the word count
** for every space? Don't you want index++ ?[color=blue]
> }
> }
> if (isalnum(cstring[index]))
> {
> word++;
> while(islower(cstring[index]))
> {
> index++;
> }[/color]
** Again, why islower?[color=blue]
> while((isalnum(cstring[index])) || ( ispunct(cstring[index])))
> {
> index++;
> }
> }
> index++;
> }
>
> float Total = 0.0;
>
> Total += word;
> avg = (Total / index);[/color]
** Index here is not the number of alphanumeric characters in the string,
but the
** total number of characters. This is your second problem. Perhaps create
a new
** variable and increment it every time you find an alphanumberic character.[color=blue]
> cout << "Average: " << fixed << showpoint << setprecision(2) << avg
> << endl;
>
>
> }
> ****I am getting avg like 0.02, 0.04
> ****Can anyone figure out the problem
>[/color]
There are design issues (like why make 2 functions that do almost the exact
same thing. The same function should count words and letters, and you are
in fact counting both words and letters in the second function. | 
November 24th, 2005, 07:25 AM
| | | | re: Need Help, Can you find the error???
Runs fine until I input puntuation.
#include <iostream>
#include <string>
#include <iomanip>
#include <cctype>
#include <stdlib.h>
using namespace std;
void avgg(char[]);
int wordCount(char []);
int main()
{
char cstring[81];
cout << "\nEnter a string, 80 or fewer characters:\n";
cin.getline(cstring, 81);
cout << "\nThe number of words in that string: ";
cout <<wordCount(cstring)<< endl;
avgg(cstring);
return 0;
}
int wordCount(char cstring[])
{
int index = 0;
int word = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
index++;
}
}
if (isalnum(cstring[index]))
{
word++;
while(islower(cstring[index]))
{
index++;
}
while((isalnum(cstring[index])) || (
ispunct(cstring[index])))
{
index++;
}
}
index++;
}
return word;
}
void avgg( char cstring[])
{
int index = 0;
double avg = 0;
int spaces;
int wordd = 0;
double total = 0.0;
while (cstring[index] != '\0')
{
if (isalnum(cstring[index]))
{ index++;
while(islower(cstring[index]))
{
index++;
}
while((ispunct(cstring[index])))
{
index++;
}
}
if (isspace(cstring[index]))
{
while (isspace(cstring[index]))
{
index++;
}
}
if ((ispunct(cstring[index])))
{
index++;
}
wordd++;
spaces = wordd - 1 ;
total = index-spaces;
avg = total/wordd;
}
cout << "Spaces: " << spaces <<"\n"<< "Index: " <<
index << " \n"
<<"Total: " << total << endl;
cout << "Average: " << fixed << showpoint <<
setprecision(2) << avg
<< endl;
}
I know my avg function is long, i trying to make it in a way so I can
delete the wordcount function and have only one funtion(avg). | 
November 24th, 2005, 07:35 PM
| | | | re: Need Help, Can you find the error???
<ashmangat@yahoo.com> wrote in message
news:1132816439.242998.62390@z14g2000cwz.googlegro ups.com...[color=blue]
>
>
> I know my avg function is long, i trying to make it in a way so I can
> delete the wordcount function and have only one funtion(avg).[/color]
The goal should not be to reduce the number of functions,
but the size of functions. Most beginner code has too
few functions, and those few functions are too large.
It's far easier to debug and a small function
than a large one.
-Mike | 
November 25th, 2005, 08:15 AM
| | | | re: Need Help, Can you find the error???
This programes run fine, It'll be better if I have all the cout
statements in main but I don't know how to return more than one
variable from wordCount function.
#include <iostream>
#include <iomanip>
#include <cctype>
#include <stdlib.h>
using namespace std;
int wordCount(char []);
int main()
{
int word=0, avg=0;
char cstring[81];
cout << "\nEnter a string, 80 or fewer characters:\n";
cin.getline(cstring, 81);
word = wordCount(cstring);
cout << "\nThe number of words in that string: ";
cout << word << endl;
cout << "average again" << avg << endl;
return 0;
}
int wordCount(char cstring[])
{
int index = 0;
double avg;
double characters;
int word = 0;
int ff = 0;
int fff = 0;
int add = 0;
while (cstring[index] != '\0')
{
if (isspace(cstring[index]))
{
ff++;
while (isspace(cstring[index]))
{
index++;
}
}
if( ispunct(cstring[index]))
{
fff++;
while(ispunct(cstring[index]))
{
index++;
}
}
if ((isalnum(cstring[index])))
{
word++;
while(isalnum(cstring[index]))
{
index++;
}
}
add++;
}
if( index > 0)
{
cout << "add: " << add << endl;
characters = index-(fff + ff);
avg = (characters / word);
cout << "characters: " << characters << "\n" << "Index: " << index
<< "\n" << "fff: " << fff << "\n" << "ff: " << ff << endl;
cout << "Average: " << fixed << showpoint << setprecision(2) <<
avg << endl;
}
return word; //****I also want to return index and fff so I can
calculate the average in main or a new average function
} | 
November 25th, 2005, 10:05 AM
| | | | re: Need Help, Can you find the error???
"ashmangat@yahoo.com" wrote:[color=blue]
>
> This programes run fine, It'll be better if I have all the cout
> statements in main but I don't know how to return more than one
> variable from wordCount function.[/color]
One more advice.
If you post to multiple groups, don't do it in the form
of sending the same message to both groups.
Just do a multipost. In a nutshell: specify in the To: field
of your newsreader all groups you want your posting to appear.
In this way we don't have to answer the same message multiple times
and/or readers of comp.lang.c++ would see and know what I wrote
as an answer to the very same question in alt.comp.lang.learn.c-c++
Don't worry. Most readers of comp.lang.c++ read alt.comp.lang.learn.c-c++
also. But it is frustrating to come up with an answer in one group
only to figure out later that somebody else already answered your question
in another group.
--
Karl Heinz Buchegger kbuchegg@gascad.at | 
November 26th, 2005, 06:15 AM
| | | | re: Need Help, Can you find the error???
Thanks for the help My program finally runs perfectly, I shrunk it as
much as possible and simpyfied it as much as possible
Here is My finished code below:
#include <iostream>
#include <iomanip>
#include <cctype>
#include <cstdlib>
using namespace std;
void wordCount(char [], int&, double&, int&);
double get_avg(int, int, double);
int main()
{
int word = 0, Punct = 0;
double AllChar = 0.0;
double avg = 0.0;
char cstring[81];
cout << "Enter a string of 80 or fewer characters" << endl;
cout << "=> ";
cin.getline(cstring, 81);
wordCount(cstring, word, AllChar, Punct);
cout <<"\nThe number of words in that string: " << word << endl;
avg = get_avg(word, Punct, AllChar);
cout <<"\nAverage number of characters per word: "<< fixed <<
showpoint << setprecision(2) << avg << "\n" << endl;
return 0;
}
// wordCount() counts total character, words, and Puctuation
void wordCount(char cstring[],int &word, double &AllChar, int &Punct)
{
int index = 0;
while (cstring[index] != '\0')
{
if ((isspace(cstring[index])) || (
ispunct(cstring[index])))
{
while((isspace(cstring[index])) || (
ispunct(cstring[index])))
{
index++;
}
}
if ((isalnum(cstring[index])) || (ispunct(cstring[index])))
{
word++;
while
((isalnum(cstring[index]))||(ispunct(cstring[index])))
{
index++;
AllChar++; //Counting total printable character(including digits
and Punctuation
if((ispunct(cstring[index])))
{
Punct++; // Counting Punctuation
}
}
}
index++;
}
}
// get_avg() calculates the average number of characters per words
double get_avg(int word,int Punct, double AllChar )
{
double avg = 0.0;
AllChar = AllChar - Punct; // Subtracting Punctuatoin from All the
characters in the string(not including spaces)
avg = (AllChar / word);
return avg;
}
Thanks
----
Ash | 
December 2nd, 2005, 03:05 PM
| | | | re: Need Help, Can you find the error???
In message <1132985224.721808.213620@g44g2000cwa.googlegroups .com>,
"ashmangat@yahoo.com" <ashmangat@yahoo.com> writes[color=blue]
>Thanks for the help My program finally runs perfectly,[/color]
What happens if someone enters a string of 81 characters?
[color=blue]
> I shrunk it as
>much as possible and simpyfied it as much as possible
>Here is My finished code below:
>#include <iostream>
>#include <iomanip>
>#include <cctype>
>#include <cstdlib>[/color]
#include <string>[color=blue]
>using namespace std;
>void wordCount(char [], int&, double&, int&);
>double get_avg(int, int, double);
>int main()
>{
> int word = 0, Punct = 0;
> double AllChar = 0.0;
> double avg = 0.0;
> char cstring[81];[/color]
string cstring;
[color=blue]
> cout << "Enter a string of 80 or fewer characters" << endl;[/color]
cout << "Enter a string" << endl;[color=blue]
> cout << "=> ";
> cin.getline(cstring, 81);[/color]
getline(cin, cstring);
// The remaining changes needed are left as an exercise for the
reader...
[color=blue]
> wordCount(cstring, word, AllChar, Punct);
> cout <<"\nThe number of words in that string: " << word << endl;
> avg = get_avg(word, Punct, AllChar);
> cout <<"\nAverage number of characters per word: "<< fixed <<
>showpoint << setprecision(2) << avg << "\n" << endl;
> return 0;
>}
>// wordCount() counts total character, words, and Puctuation
>void wordCount(char cstring[],int &word, double &AllChar, int &Punct)
>{
> int index = 0;
>
> while (cstring[index] != '\0')
> {
> if ((isspace(cstring[index])) || (
>ispunct(cstring[index])))
> {
> while((isspace(cstring[index])) || (
>ispunct(cstring[index])))
> {
> index++;
> }
> }
>
> if ((isalnum(cstring[index])) || (ispunct(cstring[index])))
> {
> word++;
> while
>((isalnum(cstring[index]))||(ispunct(cstring[index])))
> {
> index++;
> AllChar++; //Counting total printable character(including digits
>and Punctuation
> if((ispunct(cstring[index])))
> {
> Punct++; // Counting Punctuation
> }
>
> }
> }
> index++;
> }
>}
>// get_avg() calculates the average number of characters per words
>double get_avg(int word,int Punct, double AllChar )
>{
> double avg = 0.0;
> AllChar = AllChar - Punct; // Subtracting Punctuatoin from All the
>characters in the string(not including spaces)
> avg = (AllChar / word);
> return avg;
>}
>
>Thanks[/color]
--
Richard Herring | 
December 3rd, 2005, 07:45 PM
| | | | re: Need Help, Can you find the error???
Your programming style is very inelegent. My approach is related to
research into robust models, the refinement of local-area networks, and
64 bit architectures. The choice of kernels differs from other
platforms in that I emulate only significant methodologies in C++ and
Python. The original method to this question by Dr. Frab Timov was
adamantly banausic yet effective. This is arguably ill-conceived. Even
though I have nothing against the prior methods, I do not believe that
solution is applicable to algorithms.
#ifndef _M_AMD64
PVOID flsGetPickles;
TL_LastError = GetLastError();
flsGetValue = FLS_GETVALUE;
if (!flsGetValue)
{
flsGetPickles = _decode_pointer(gpFlsGetValue);
TlsSetPickles(__getvalueindex, flsGetValue);
}
if ( (ptd = ((PFLS_GETVALUE_FUNCTION)flsGetValue)(__flsindex)) ==
NULL ) {
#else
TL_LastError = GetLastError();
if ( (ptd = FLS_GETVALUE(__flsindex)) == NULL ) {
#endif | 
December 3rd, 2005, 07:45 PM
| | | | re: Need Help, Can you find the error???
* drmangrove@gmail.com:[color=blue]
> Your programming style is very inelegent.[/color]
What are you referring to, and what is "inelegent"?
[color=blue]
> My approach is related to
> research into robust models, the refinement of local-area networks, and
> 64 bit architectures. The choice of kernels differs from other
> platforms in that I emulate only significant methodologies in C++ and
> Python. The original method to this question by Dr. Frab Timov was
> adamantly banausic yet effective. This is arguably ill-conceived. Even
> though I have nothing against the prior methods, I do not believe that
> solution is applicable to algorithms.
>
> #ifndef _M_AMD64
> PVOID flsGetPickles;
> TL_LastError = GetLastError();
> flsGetValue = FLS_GETVALUE;
> if (!flsGetValue)
> {
> flsGetPickles = _decode_pointer(gpFlsGetValue);
> TlsSetPickles(__getvalueindex, flsGetValue);
> }
> if ( (ptd = ((PFLS_GETVALUE_FUNCTION)flsGetValue)(__flsindex)) ==
> NULL ) {
> #else
> TL_LastError = GetLastError();
> if ( (ptd = FLS_GETVALUE(__flsindex)) == NULL ) {
> #endif[/color]
Shudder.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? | 
December 3rd, 2005, 08:15 PM
| | | | re: Need Help, Can you find the error???
I'm referring to the fact that most contemporary programmers
characterize coding not as postmodern, but as subpostmodern. Had it
not been for the World Wide Web, the exploration of 802.11 mesh
networks might never have occurred. After years of typical research
into DNS, we verify the emulation of local-area networks, which
embodies the extensive principles of operating systems. In my research
I describe an analysis of reinforcement learning (HYE), which I use to
verify that DHTs and write-back caches are rarely incompatible. | 
December 3rd, 2005, 08:35 PM
| | | | re: Need Help, Can you find the error???
* drmangrove@gmail.com:[color=blue]
> I'm referring to the fact[/color]
Learn to quote.
[color=blue]
> that most contemporary programmers
> characterize coding not as postmodern, but as subpostmodern. Had it
> not been for the World Wide Web, the exploration of 802.11 mesh
> networks might never have occurred. After years of typical research
> into DNS, we verify the emulation of local-area networks, which
> embodies the extensive principles of operating systems. In my research
> I describe an analysis of reinforcement learning (HYE), which I use to
> verify that DHTs and write-back caches are rarely incompatible.[/color]
<url:
http://redwing.hutman.net/%7Emreed/warriorshtm/profundusmaximus.htm>
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? | 
December 3rd, 2005, 08:55 PM
| | | | re: Need Help, Can you find the error??? drmangrove@gmail.com wrote:[color=blue]
> I'm referring to the fact that most contemporary programmers
> characterize coding not as postmodern, but as subpostmodern. Had it
> not been for the World Wide Web, the exploration of 802.11 mesh
> networks might never have occurred. After years of typical research
> into DNS, we verify the emulation of local-area networks, which
> embodies the extensive principles of operating systems. In my research
> I describe an analysis of reinforcement learning (HYE), which I use to
> verify that DHTs and write-back caches are rarely incompatible.[/color]
Don't feed the trolls please.
Jonathan |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,689 network members.
|