Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DirectX 10 Pin
CPallini27-Sep-09 23:42
mveCPallini27-Sep-09 23:42 
GeneralRe: DirectX 10 Pin
MrMcIntyre28-Sep-09 0:11
MrMcIntyre28-Sep-09 0:11 
GeneralRe: DirectX 10 Pin
CPallini28-Sep-09 0:52
mveCPallini28-Sep-09 0:52 
GeneralRe: DirectX 10 Pin
MrMcIntyre28-Sep-09 1:07
MrMcIntyre28-Sep-09 1:07 
GeneralRe: DirectX 10 Pin
CPallini28-Sep-09 1:51
mveCPallini28-Sep-09 1:51 
QuestionDestructors with inherited classes -- "Destructors 101"? Pin
Xpnctoc27-Sep-09 9:26
Xpnctoc27-Sep-09 9:26 
AnswerRe: Destructors with inherited classes -- "Destructors 101"? Pin
Xpnctoc27-Sep-09 9:50
Xpnctoc27-Sep-09 9:50 
QuestionWhy am I crashing at the end of the Program Pin
Herboren27-Sep-09 7:06
Herboren27-Sep-09 7:06 
My code was compiled correctly, no errors or bugs. but when I run the program by the time I get to the end I get a fatal exception. Here is my code:

// healthcare_statics.cpp : Defines the entry point for the console application.
//
//cout << "" << endl;
// #include <>
#include "stdafx.h"
#include <iomanip>
#include <iostream>
#include <fstream>
#include <conio.h>
#include <windows.h>
#include <string>
#include <stdio.h>

using namespace std;

//Resident stats
struct resident{
	char firstName[64];			//Residents First name
	char lastName[64];			//Residents Last name
	char middleName[64];			//Residents Middle name
	unsigned short int ageRes;	//Residents age
	string dob;
	unsigned long int social;
	string eyeColor;
	string hairColor;
	int height;
	char gnd[12];					//Gender
};
//Family stats
struct family {
	string gContact_F; //Resident Guardian A
	string gContact_L;
	string gContact_f; //Resident Guardian B
	string gContact_l;
};
//Term Stay
struct term {
	char Term[12];  //Term
	unsigned short int  monthTerm;    //Term status
};

void Resident();
void Stats();
void Term();
void ouFstream();

int _tmain(int argc, _TCHAR* argv[])
{
	Resident();
	Stats();
	Term();
	ouFstream();
	_getch();
	return 0;
}
void Resident(){
	resident r;
	cout << "\n\tPlease input the residents information below." << endl << endl;
	cout << "       First Name: "; cin >> r.firstName;
	cout << "      Middle Name: "; cin >> r.middleName;
	cout << "        Last Name: "; cin >> r.lastName;
	cout << "              Age: "; cin >> r.ageRes;
	cout << "    Date of Birth: "; cin >> r.dob;
	cout << "             SSN#: "; cin >> r.social;
	cout << "        Eye Color: "; cin >> r.eyeColor;
	cout << "       Hair Color: "; cin >> r.hairColor;
	cout << "           Height: "; cin >> r.height;
	cout << "           Gender: "; cin >> r.gnd;
	cout << endl << endl;
}
void Stats(){
	family s;
	cout << "Family Contact(1)." << endl << endl;
	cout << "       First Name: "; cin >> s.gContact_F;
	cout << "        Last Name: "; cin >> s.gContact_L;
	cout << "\t---------" << endl;
	cout << "Family Contact(2)." << endl << endl;
	cout << "       First Name: "; cin >> s.gContact_f;
	cout << "        Last Name: "; cin >> s.gContact_l;
	cout << endl << endl;
}void Term(){
	term t;
	cout << "Long term/Short (L/S)" << endl << endl;
	cout << "             Term: "; cin >> t.Term;
	cout << "         Month(s): "; cin >> t.monthTerm;
	cout << endl << endl;
}
void ouFstream(){
	
	char MM[64];
	char DD[12];
	char YYYY[12];
	char mm[64];
	resident R;
    
	cout << "Input date of application." << endl << endl;
	cout << "           Month: "; cin >> MM;
	cout << "             Day: "; cin >> DD;
	cout << "            Year: "; cin >> YYYY;
	strcat (MM, "_"); 
	strcat (MM, DD); 
	strcat (MM, "_"); 
	strcat (MM, YYYY); 
	strcat (MM, "_mem#_"); 
	strcat (MM, R.lastName);

	ofstream output;
	output.open("Healthcare_Statistics.txt");
	if(output.fail()){
		cout << "Failed opening file: " << output << "!" << endl;
		exit(1);}

}

AnswerRe: Why am I crashing at the end of the Program Pin
CPallini27-Sep-09 8:50
mveCPallini27-Sep-09 8:50 
AnswerRe: Why am I crashing at the end of the Program Pin
«_Superman_»27-Sep-09 16:28
professional«_Superman_»27-Sep-09 16:28 
AnswerRe: Why am I crashing at the end of the Program Pin
David Crow28-Sep-09 4:05
David Crow28-Sep-09 4:05 
QuestionActiveX dll Qt4.4 update issue.... Pin
hfe087127-Sep-09 4:31
hfe087127-Sep-09 4:31 
QuestionLast modified file time, is it fixed everywhere? Pin
includeh1027-Sep-09 3:13
includeh1027-Sep-09 3:13 
AnswerRe: Last modified file time, is it fixed everywhere? Pin
Saurabh.Garg27-Sep-09 17:44
Saurabh.Garg27-Sep-09 17:44 
QuestionHow to reduce exe size? Pin
includeh1027-Sep-09 2:31
includeh1027-Sep-09 2:31 
AnswerRe: How to reduce exe size? Pin
«_Superman_»27-Sep-09 2:50
professional«_Superman_»27-Sep-09 2:50 
GeneralRe: How to reduce exe size? Pin
sunlin727-Sep-09 2:54
sunlin727-Sep-09 2:54 
GeneralRe: How to reduce exe size? Pin
CPallini27-Sep-09 23:25
mveCPallini27-Sep-09 23:25 
AnswerRe: How to reduce exe size? Pin
sunlin727-Sep-09 2:56
sunlin727-Sep-09 2:56 
GeneralRe: How to reduce exe size? Pin
includeh1027-Sep-09 3:19
includeh1027-Sep-09 3:19 
GeneralRe: How to reduce exe size? Pin
harold aptroot27-Sep-09 4:20
harold aptroot27-Sep-09 4:20 
GeneralRe: How to reduce exe size? Pin
Iain Clarke, Warrior Programmer27-Sep-09 10:40
Iain Clarke, Warrior Programmer27-Sep-09 10:40 
AnswerRe: How to reduce exe size? Pin
Luc Pattyn27-Sep-09 12:20
sitebuilderLuc Pattyn27-Sep-09 12:20 
AnswerRe: How to reduce exe size? Pin
Joe Woodbury27-Sep-09 17:00
professionalJoe Woodbury27-Sep-09 17:00 
AnswerRe: How to reduce exe size? Pin
CPallini27-Sep-09 23:34
mveCPallini27-Sep-09 23:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.