Clinton Portis 211 Practically a Posting Shark

The best way to solve this would be to uninstall your compiler and turn off your computer.

Leave it off for as long as possible for best results.

WaltP commented: Very helpful. I'm impressed with your grasp of the situation. -2
Clinton Portis 211 Practically a Posting Shark

I can't read this C style file i/o.

Clinton Portis 211 Practically a Posting Shark

1. try opening the file in binary and see if you still experience the same type of behavior

2. without seeing your code, i am not sure what you are using.. but you may have problems with these ascii values exceeding the 8bit capacity of the char data type.

the default signed char will allow ascii values up to 127 without experiencing overflow. an unsigned char will allow ascii values up to 255.

most unicode implementations allow use of a WORD type that will support 16bits which I believe is capable of handling all char sets.

one solution if you want to stick to native c++ types, would be to use a wchar_t which is 2 or 4 bytes, depending on your operating system.

Clinton Portis 211 Practically a Posting Shark

Any luck with that error?

The only thing I can recommend at this point, is if you do get this thing to compile, I want you to do two things:

1. click on the .exe and drag it to the recycle bin
2. release the mouse button

You may also want to consider a full uninstall of your compiler as well. I can walk you through the steps if you require assistance.

Clinton Portis 211 Practically a Posting Shark

Probably the most efficient method that I could think of (in terms of line of code) would probably be something like this:

#include<algorithm>
#include<cstring>

char line[] = "Dance, too much booty in the pants.";
int size = strlen(line);

replace(&line[0], &line[size], ' ', '_');


replace() from <algorithm>

Clinton Portis 211 Practically a Posting Shark

You seem obviously confused and not really sure about what's going on. So I'll make life simple for you.

For now, it's ok to assume correct user input.

With that out of the way, now you can focus on the program.

It's ok to use the pow() function from cmath.

Just because the pow() function does not take unsigned arguments has no effect on the rest of the program whatsoever.

Consistent correct math will out weigh any negative consequences you can think of.

The only data types that we absolutely need to have 'unsigned' are those that we wish to perform bit level operations.

With intel x86 architecture, binary numbers are read 'right to left' (ok so I just answered my own question)

Therefore, all the code I have supplied you thus far has been correct.

Clinton Portis 211 Practically a Posting Shark

we almost made it half way through step #1, until we ran into a rather significant problem:

this my assignment..

1. Make a C program

Fyi: you are in a C++ forum.

Clinton Portis 211 Practically a Posting Shark

I'm not sure if you are learning a different style of file i/o, but it's like nothing I've ever seen.

This is the general procedure I've been taught:

1. create an 'ifstream' object (to read from a file)
2. attempt to open a file.
3. perform error checking (to see if file actually opened)
4. if file open successful, read the file into a data structure of your choice (string or vector seem to be popular)
5. close the ifstream object.
6. perform desired operations with the newly loaded data.
7. create an 'ofstream' object (for writing to a file)
8. open (or create new) a file.
9. write to the file.
10. close the ofstream object.

Now, with that out of the way, you have even more fundamental issues:

//Try this:
void OpenFile(fstream& file, string& fileName)
 {     
     file.open(fileName.c_str(), ios::in|ios::trunc);    

     if (!file.is_open())
     {
          cout << "\a\nCouldn't open file..!!!";
          cout <<"\nEnsure that file exists, is in the proper location, has not been renamed or deleted.";
          cout << "\nProgram will now terminate in preparation for file troubleshooting... ";
          cout << "\nPress [Enter] to exit program ";
          cin.get();
          exit(EXIT_FAILURE);
     }
}
Clinton Portis 211 Practically a Posting Shark

I'm not totally convinced that your power() function is working properly....

If you weren't familiar with the pow() function, it's derived from <cmath>

Give it a try and see if that works any better for ye'.


And yes, there is also a significant issue here with how the binary number is entered by the user.

If the user elects to read the binary number 'right-to-left', as the user types it in, it will appear 'left-to-right' on the screen...

If the user decides to make the screen entry look 'right-to-left'... the user would actually have to input the numbers 'left-to-right.'

I didn't write all this to purposely confuse you. I've been taught to read binary both ways. I'm not sure if there is a set standard.

After you are done with this program, I would recommend providing thorough prompts to the user on how you want your data entered. Some error checking could also be done as well; you could provide the user the base 10 numerical version of the number and ask for verification if this is correct, for example.


In this code below, 'number' is affected by all the bit shifting. I probably should have saved it so I could use it later for console display:

output:
bool bit = 0;
string twocomp;
//save this before messing it up!
unsigned int temp = number;

for(int i=0, size=binary.size(); i<size; i++)
{
     //Get right-most bit
     bit …
Clinton Portis 211 Practically a Posting Shark

I think the major extent of your problem takes place at lines #26 thru 28.

The <fstream> class does not include an overloaded assignment operator. I believe the only operators overloaded for this class are the << insertion, >> extraction, and ! 'not' operators. Everything else (including the = assignment operator) is unusable.

So, in your attempt to assign the resulting 'return' from OpFile() to your 'INPUT" object (which I believe is incorrectly declared as 'fstream' as opposed to 'ifstream'), the compiler does not know how to resolve this assignment operation as it is an aggregate data type.

Suggestion:
Make OpFile() a 'void' function. Pass in your <fstream> object into this function along with a string file name. Perform the open operation inside of the function.

What you are essentially doing is making a 'wrapper' for the open() function... your other option would be just to explicitly open the files directly from your ifstream objects in main().

There are other issues with your code. I'm sure let us know about them in due time.

Clinton Portis 211 Practically a Posting Shark

I'll tell you now, there is absolutely nothing wrong with an older woman. I ask that you expand your horizons to the include the cougar age group.

Next time you see her, tell her that you want to 'sink her battleship.'

Clinton Portis 211 Practically a Posting Shark

shes out of town,

so she's out of town 'taking care of her needs' while you are here having to learn a somewhat complex object oriented programming language in false dellusional hope that you might get a piece of the action.

i can tell you now, that if you haven't closed the deal it's not going to happen.

next time, she has to 'pay up front' if you know what i mean.

Clinton Portis 211 Practically a Posting Shark

I'm sorry to say this hombre... unless she is giving it up, you better grow a pair and tell her to do her own @#@$!@#$ homework.

(however, if she is giving it up I'll be glad to assist you in anyway i can)

Clinton Portis 211 Practically a Posting Shark

What you have there appears to be the makings of 3 functions: parallel(), gauss(), and barrier().

The code does not adhere to the proper format of a c++ function.

Additionally, the functions are not associated with any main() driver or WinMain() entry point.

What you have there appears to be a code snippet taken out the context of a working program used as an example to teach some sort of algorithmic concept(s).

So.. if you wanted to actually use this code, it appears that you would have to code up some sort of multi-threaded program, format the above code as proper functions, and pass in the appropriate arguments.

Clinton Portis 211 Practically a Posting Shark

who's program is it..???

why do you have it....??!??!

more importantly, can I have a cut of what he is paying you..?

Clinton Portis 211 Practically a Posting Shark

sry to make this so confusing. in need the function called updateCounter. and what it should do is to update the map to show if i have it the target or not. hope that was clearer.

Translation:

"I'm sorry to make this so confusing. I need to develop a function called, 'updateCounter.' It should update the map to show if I have hit the target or not."


It appears that you load a 2 dimensional array with ship positions. You should compare user input to the corresponding element of the array. If the element is occupied, then return hit, else return miss.

If hit, make a 'hit' assignment to the array, else update the array with a miss indication.

Redraw the array and prompt for next user guess.

Clinton Portis 211 Practically a Posting Shark

You are in charge of a high profile software design consulting firm. A customer bursts through the front door, comes running in flailing his arms wildly about, stops at your cubicle, looks you square in the eye and makes the following demand:

the ocean file has to be made separately by 15 by 15, but this is simple and i can do this. what i need help with is the update counter. which is i think to update the map. plese help me out!!!

Q: How do you respond...

Clinton Portis 211 Practically a Posting Shark

Get number (in binary) and enter into a string:

string binary;

cout << "Enter a binary number: ";
cin >> binary;

Turn a binary number into a real number:

#include<algorithm>
unsigned int number = 0;
int exp = 0;

//I think most people read binary right-to-left
//the conversions are made easier (for me) if we flip it around
reverse(&binary[0], &binary[binary.size()]);

for(int i=0, size=binary.size(); i<size; i++)
{
     if(binary[i] == '1')
     {
          number += pow(2, exp);
     }

     exp = pow(2, exp);
}

unsigned int orig_number = number;

Perform 2's compliment:

number = ~number + 1;

Turn it back into a string:

bool bit = 0;
string twocomp;

for(int i=0, size=binary.size(); i<size; i++)
{
     //Get right-most bit
     bit = number & 1;

     if(bit)
     {
          twocomp += '1';
     }
     else
     {
          twocomp += '0';
     }

     //Shift all bits right one place
     number >>= 1;
}

Display useful information to the user:

//Flip the 'binary' strings back around so people can read it right-to-left
reverse(&binary[0], &binary[binary.size()]);
reverse(&twocomp[0], &twocomp[twocomp.size()]);

cout << "The orignal number entered in binary: " << binary;
cout << "Which is: " << orig_number;
cout << "The 2's compliment is: " << twocomp;
cout << "Which is: " << number;

*The above code is untested, uncompiled, and may contain simple easy to fix errors; it is intended as a suggestion only. If you see a better way to do this, I am always open to suggestions.

Clinton Portis 211 Practically a Posting Shark

Firstly, your evaluations of boolean expressions are incorrect.

Rule of thumb: boolean logic is handled per expression, or as a stand-alone TRUE/FALSE flag.

In your loop condition, you are trying to handle everything at once. It is important that each individual expression be able to resolve to true or false.

I would code you up an efficient way to handle your loop condition; however, without seeing your code, anything that I give you at this point would be based on speculation.

Clinton Portis 211 Practically a Posting Shark

I use whatever works...

I've spent hours looking for a compiler that could handle one single line of code before.

You never know what comes with what compiler. Nothing works for everything.

Clinton Portis 211 Practically a Posting Shark

1. create an ifstream object for file reading
2. Attempt to open the file
3. Perform error checking to see if file opened
4. If open successful, read file into a data structure of your choice (string seems to be popular)
5. close the ifstream object
6. Alter the data as you wish
7. create an ofstream object for file writing
8. open the file using the ios::trunc flag which will clear the file
9. write the newly altered data to file
10. close your ofstream object.

Clinton Portis 211 Practically a Posting Shark
cout << "**********";
Clinton Portis 211 Practically a Posting Shark

Out of curiosity, I looked up the documentation for endl and might have some sort of answer for ye':

endl

manipulator function
<ostream>

ostream& endl ( ostream& os );

Insert newline and flush
Inserts a new-line character.
Additionally, for buffered streams, endl flushes the buffer (i.e. writes all unwritten characters in the buffer to the output sequence, see ostream::flush).

It seems to me the ability to flush the output buffer may have a beneficial affect as compared to it's '\n' newline ascii counterpart, which to my knowledge does not flush the buffer.

Clinton Portis 211 Practically a Posting Shark

One slight adjustment to your code will allow the user to add many names:

#include <iostream>

struct SInfo {
    string name[100];
};

int main() 
{
    SInfo info[20];
    char again = '\0';
    int counter = 0;
 
    do{
             cout << "First name: ";
             std::cin >> info[counter].name;
             cout << "\nWould you like to enter another name?  (Y/N) ";
             std::cin >> again;
             counter++;
     }while(again == 'y' || again == 'Y');

     std::cout << "\nHere is the list of names: \n\n";

     for(int i=0; i<counter; i++)
     {
             std::cout << info[i].name << endl;
     }

     return 0;
}
Clinton Portis 211 Practically a Posting Shark

Here is probably the best tutorial you will ever get on binary search trees. I recommend you become very familiar with this if you plan to have any success with your homework:

http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx

Clinton Portis 211 Practically a Posting Shark

Sooooooo...... do you need help with anything......?

Clinton Portis 211 Practically a Posting Shark

Many have recommended the curl library for applications that need to interface with the net.

Clinton Portis 211 Practically a Posting Shark

You forgot about virtualpolymoricfunctions.

Clinton Portis 211 Practically a Posting Shark

You'll probably have to take in the entire line using getline() then parse the line up into individual words:

#include<cstring>

swine[100];
char* words[30];

cout << "Enter line: ";
cin.getline(swine, 100);

//break it up
int =0;
words[0] = strtok(swine, ' ');
while(swine[i] != NULL)
{
     words[i] = strtok(NULL, ' ');
     i++;
}

//Now you have the ability to do something like this
for(int i=0; i<word_count; i++)
{
     to_piglatin(words[i]);
}

//Now copy all the pig latinized words back into a single buffer
char buffer[100];
for(int i=0; i<word_count; i++)
{
     strcat(buffer, words[i]);
     strcat(buffer, ' ');
}

Here is the documentation for strtok()

Clinton Portis 211 Practically a Posting Shark

I think getting down with binary trees is an exellent skill to have:

http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx

Clinton Portis 211 Practically a Posting Shark

To be honest, I'm not really sure what is going on with your machine; however, I do believe that if we can gather the current state of your font and text settings, maybe we could come up with some ideas.

I would like to determine what charset your machine is using.. maybe it would give us a little insight as to what is going on.

All I am asking is that you compile the above code either by itself or you can also add to your program at various points.

Here is another function we could consider in our efforts to get a peek inside of your machine:

GetFontLanguageInfo() Function

The GetFontLanguageInfo function returns information about the currently selected font for the specified display context. Applications typically use this information and the GetCharacterPlacement function to prepare a character string for display.

Syntax

DWORD GetFontLanguageInfo(
  __in  HDC hdc
);

Parameters
hdc [in]
Handle to a display device context.

Return Value
The return value identifies characteristics of the currently selected font. The function returns 0 if the font is "normalized" and can be treated as a simple Latin font; it returns GCP_ERROR if an error occurs. Otherwise, the function returns a combination of the following values.

Clinton Portis 211 Practically a Posting Shark

Here another idea..

The problem might be in line #71, where you pass in an argument as a char*

I'm thinkin' since you are using a 2d array, maybe try passing stuff in as a char**

T** maxn(T** a, const int n)
Clinton Portis 211 Practically a Posting Shark

In order to get done what you want done, you'd have to make an array of pointers...

//This will result in the 'const char' that you are trying to avoid
char strs[numStrs][maxLength];

//Try this:
//Dynamically allocated 2d array
char** strs = new char*[numStrs];
for(int i=0; i<numStrs; i++)
     strs[i] = new char[maxLength];

//Now you should be able to pass in the array as a 'cstring'(char*) 
//as opposed to a 'char literal' (const char array)
if(std::strlen(a[i]) > std::strlen(a[longest]))
Clinton Portis 211 Practically a Posting Shark

I think that it is important that we focus on the origins of pig latin and how it is properly implemented:

Pig Latin is a language game of alterations played in English. To form the Pig Latin form of an English word the initial consonant sound is transposed to the end of the word and an ay is affixed (for example, trash yields ash-tray and plunder yields under-play). The purpose of the alteration is to both obfuscate the encoding and to indicate for the intended recipient the encoding as 'Pig Latin'. The reference to Latin is a deliberate misnomer, as it is simply a form of jargon, used only for its English connotations as a 'strange and foreign-sounding language'; it could also be because the transformed words sound similar to Latin.

Rules and variations
The usual rules for changing standard English into Pig Latin are as follows:

In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and "ay" is added, as in the following examples:
beast → east-bay
dough → ough-day
happy → appy-hay
question → estion-quay
star → ar-stay
three → ee-thray
In words that begin with vowel sounds or silent consonants, the syllable "ay" is added to the end of the word.
Transcription varies. A hyphen or apostrophe is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means "spray" …

Clinton Portis 211 Practically a Posting Shark

Just out of curiosity, have you tried performing the file operations while opened in binary mode?

//sometimes when I can't figure stuff out, I'll see if the same behavior
//exists in binary mode:
preprocess.open ("data//dataset.dat", ios::out|ios::binary);
recordList.open ("data//answers.dat", ios::out|ios::binary);
Clinton Portis 211 Practically a Posting Shark

Your code looked pretty good, and just glancing over your code, I was kinda stumpted at first, but I think I might have a possible solution for ye'...

I believe that your .dat files contain a bunch of stuff. You read in the files succesfully without incident.

I believe the problem occurs when you open the files for writing using your ofstream objects; you open the files in the default mode (ios::out) which is fine... but I do believe the file 'put' pointer is set to the beginning of the files by default (this is not specifically mentioned in the documentation for ofstream's open() function... this conclusion is based soley on my experience.)

My suggestion is to open your files with your 'ofstream' object using the ios::ate flag to ensure that you are not attempting to over-write existing file data (which I think can lead to unpredictable performance):

//Feel free to use the bitwise OR operator to combine flags to meet your needs
preprocess.open ("data//dataset.dat", ios::out|ios::ate);
recordList.open ("data//answers.dat", ios::out|ios::ate);

Now you should be able to append data 'at the end' of your files.

Clinton Portis 211 Practically a Posting Shark
Clinton Portis 211 Practically a Posting Shark

when i run the program it display nothing.n no files by dat name is shown in that folder

I'm sure you've tested the fail bit indicators of your 'ofstream' object after your attempt to open() the destination folder and found that there were no errors.

So I can only assume you are looking in the wrong location.

Clinton Portis 211 Practically a Posting Shark
#include<algorithm>

double populateArray(int numberOfElementsToStore[] )
{
	int i = 0 ;
	for (int i = 0; i < ARRAY_SIZE; i++)
	{
		numberOfElementsToStore[i] =  10  + 25 * ((double) rand( ) / (double) RAND_MAX ) ;

	}	
                
         //This will make like values reside next to each other in the array
         sort(&numberOfElementsToStore[0], &numberOfElementsToStore[ARRAY_SIZE]);
         //This will remove consecutive like amounts
         unique(&numberOfElementsToStore[0], &numberOfElementsToStore[ARRAY_SIZE]);

         return i ;
}

unique

function template<algorithm>template <class ForwardIterator>
ForwardIterator unique ( ForwardIterator first, ForwardIterator last );

template <class ForwardIterator, class BinaryPredicate>
ForwardIterator unique ( ForwardIterator first, ForwardIterator last,
BinaryPredicate pred );
Remove consecutive duplicates in range

Removes the duplicate consecutive elements from the range [first,last). This is done by removing all the elements that compare equal to the element right preceding them (only the first element in each group of consecutive equal elements is kept).

Clinton Portis 211 Practically a Posting Shark

This does give me numbers, but not distinct. Thanks!

dis·tinct (d-stngkt)
adj.
1. Readily distinguishable from all others; discrete: on two distinct occasions.
2. Easily perceived by the senses or intellect; clear: a distinct flavor.
3. Clearly defined; unquestionable: at a distinct disadvantage.
4. Very likely; probable: There is a distinct possibility that she won't come.
5. Notable: a distinct honor and high privilege.

I don't understand what you mean by 'distinct' numbers.. do you mean 'unique'? (a number only used once within your array?)

Clinton Portis 211 Practically a Posting Shark

Here is an article explaining CALLBACK functions (good article I actually learned a lot)
http://www.codeguru.com/cpp/cpp/cpp_mfc/callbacks/article.php/c10557/

Chapter #3 in Petzold's, "Programming Windows 5th Edition" explains a lot about windows creation and message handling. According to Petzold (p. 62):

A window's procedure is always defined like this:

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

The four parameters to the window procedure are identical to the first four fields of the MSG structure. The first parameter is hwnd, the handle to the window receiving the message.....

The second parameter is the same as the same as the message field in the MSG structure. It's a number that identifies the message....

Suprisingly, Petzold doesn't go into detail about the WPARAM and LPARAM arguments, but begins to give example code of how to process these as windows messages.

Here is what the MSG struct looks like:

typedef struct {
    HWND hwnd;
    UINT message;
    WPARAM wParam;
    LPARAM lParam;
    DWORD time;
    POINT pt;
} MSG, *PMSG;
Clinton Portis 211 Practically a Posting Shark

#define SIGHUP 1 /* hangup */
#define SIGINT 2 /* interrupt */
#define SIGQUIT 3 /* quit */
#define SIGILL 4 /* illegal instruction (not reset when caught) */
#define SIGTRAP 5 /* trace trap (not reset when caught) */
#define SIGABRT 6 /* abort() */
#if defined(_POSIX_C_SOURCE)
#define SIGPOLL 7 /* pollable event ([XSR] generated, not supported) */
#else /* !_POSIX_C_SOURCE */
#define SIGIOT SIGABRT /* compatibility */
#define SIGEMT 7 /* EMT instruction */
#endif /* !_POSIX_C_SOURCE */
#define SIGFPE 8 /* floating point exception */
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
#define SIGBUS 10 /* bus error */
#define SIGSEGV 11 /* segmentation violation */
#define SIGSYS 12 /* bad argument to system call */
#define SIGPIPE 13 /* write on a pipe with no one to read it */
#define SIGALRM 14 /* alarm clock */
#define SIGTERM 15 /* software termination signal from kill */
#define SIGURG 16 /* urgent condition on IO channel */
#define SIGSTOP 17 /* sendable stop signal not from tty */
#define SIGTSTP 18 /* stop signal from tty */
#define SIGCONT 19 /* continue a stopped process */
#define SIGCHLD 20 /* to parent on child stop or exit */
#define SIGTTIN 21 /* to readers pgrp upon background tty read */
#define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
#if !defined(_POSIX_C_SOURCE)
#define SIGIO 23 /* input/output possible signal */
#endif
#define SIGXCPU 24 /* exceeded CPU time limit */
#define SIGXFSZ 25 /* exceeded file size limit */

Clinton Portis 211 Practically a Posting Shark

Ok ok.. I'll do it for you. No thinking, effort, learning or attempt at trying required on your part:

for (int row=0; row < monkey; row++)
{
        leastAmount=0;
        
        for (int col=0; col < days-1; col++)
        {
            if(FoodForMonkey[row][col] > FoodForMonkey[row][col+1])
                 if(leastAmount > FoodForMonkey[row][col+1])
                 {
                       leastAmount = FoodForMonkey[row][col+1];                    
                 }
            cout << row+1 <<". Monkey " << " = " << leastAmount<< endl; 
        }
Clinton Portis 211 Practically a Posting Shark

I think I remember some construct of the windows api that allows one to enumerate system devices....

Allow me to break into the windows bible and I'll get back to you on this...

[edit]

As I am doing more research on this topic, I did find this forum post you may want to take a look at:
http://www.nuclearglory.com/php-bin/forums/view_topic.php?id=1308&forum_id=1

It discusses a 'multiport SDK' as well as drivers that support multi-mice.

Clinton Portis 211 Practically a Posting Shark

I thought this website on coding conventions was pretty cool.. learned some things that I never knew before:

http://www.possibility.com/Cpp/CppCodingStandard.html#init

I was just wondering:

If there are any conventions in particular you agree or disagree with (and why)

If this would be worthy of being a 'sticky post' as I think a lot of new coders would gain valuable knowledge from learning modern coding conventions.

One topic, for example, that I never considered were the possible issues associated with throwing exceptions inside of a destructor.

Another involves the coding out large blocks of code:

You can't use /**/ style comments because comments can't contain comments and surely a large block of your code will contain a comment, won't it?

If there was something of interest you weren't aware of before reading, please share.

Clinton Portis 211 Practically a Posting Shark

In your algorithm, you are continuously updating 'leastamount' based on the result of 2 vars being tested. Therefore, it will never truly hold the lest amount of the array, but will only hold the result of the last test performed.

What you should do, is introduce a third variable that will be assigned a value only at such time that it qualifies as the least amount, else increment the array and proceed to the next test.

Clinton Portis 211 Practically a Posting Shark

I think the problem is here:

void getAverage (int FoodForMonkey[][days])
{
    
    for (int col=0; col < days; col++)
    {
        float numTotal=0;
        cout << "Average amount eaten on day " << col+1;
        for (int row=0; row < monkey; row++)
        {
              //Since you are calculating a daily average, 
              //you should clear this variable each loop iteration 
              numTotal += FoodForMonkey[row][col]; 
              //You might also want to dedicate a variable to keep a running total of all days
              //if you want to calculate a total average
              total_ave += FoodForMonkey[row][col];
        }
        cout << " is " << float(numTotal/3) << endl;
        //Clear 'numTotal' in preperation for the next day's calculation
        numTotal = 0.00f;
    }                
}
Clinton Portis 211 Practically a Posting Shark

I'm sorry,portis, i'm lost.

You appear fluent in your windows programming.. I'm surprised you haven't messed around with the getting the current text attributes:

HDC hdc;
TEXTMETRIC tm;
string msg = "Current Char Set is: ";

hdc = GetDC(hwnd);

GetTextMetrics(hdc, &tm);

msg += static_cast<char>(tm.tmCharSet+'0');

MessageBox(hwnd, msg.c_str(), "Char Set:", MB_OK);
Clinton Portis 211 Practically a Posting Shark

thank you necrolin... just out of curiosity, i've been trying to get my little piece of code to work (with limited results). your example is greatly appreciated.

Clinton Portis 211 Practically a Posting Shark

White box testing (a.k.a. clear box testing, glass box testing or structural testing) uses an internal perspective of the system to design test cases based on internal structure. It requires programming skills to identify all paths through the software. The tester chooses test case inputs to exercise paths through the code and determines the appropriate outputs.
Definition from Wikipedia

Here you test the limits of your code design and data structures.

Black box testing takes an external perspective of the test object to derive test cases. These tests can be functional or non-functional, though usually functional. The test designer selects valid and invalid input and determines the correct output. There is no knowledge of the test object’s internal structure.
Definition from Wikipedia

Here you test the limits of user stupidity.