Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblems with destroying a dialog box Pin
caykahve6-Dec-05 0:24
caykahve6-Dec-05 0:24 
AnswerRe: Problems with destroying a dialog box Pin
David Crow6-Dec-05 4:09
David Crow6-Dec-05 4:09 
Questionhow to get window handle pls Pin
shadrach_india5-Dec-05 23:54
shadrach_india5-Dec-05 23:54 
AnswerRe: how to get window handle pls Pin
ThatsAlok6-Dec-05 0:54
ThatsAlok6-Dec-05 0:54 
AnswerRe: how to get window handle pls Pin
Rajesh R Subramanian6-Dec-05 1:30
professionalRajesh R Subramanian6-Dec-05 1:30 
QuestionReading text file using ifstream Pin
grero5-Dec-05 23:43
grero5-Dec-05 23:43 
AnswerRe: Reading text file using ifstream Pin
toxcct5-Dec-05 23:56
toxcct5-Dec-05 23:56 
GeneralRe: Reading text file using ifstream Pin
grero6-Dec-05 0:12
grero6-Dec-05 0:12 
Hi,
Sorry, here is the definition for the class I'm using:

#include <stdio.h>
#include <fstream>
#include <vector>
#include <ios>

class fileOperator {
protected:
	<
	std::ifstream inFile;
	std::ofstream outFile;

public:
	fileOperator() {};
	void openInputFile(const wchar_t *fname);
	void openOutputFile(const wchar_t *fname) {};
	void readMatrix(int numberOfColumns, double **matrix);
};


Using const char* was my first thought too, but my compiler doesn't seem to like it. It claims ifstream::open only accepts wchar_t* as its argument. Here's the compiler error I get:

.\fileTest.cpp(8) : error C2664: 'fileOperator::openInputFile' : cannot convert parameter 1 from 'char *' to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

There might be some blindingly obvious thing I'm missing here as I'm fairly new to C++ Smile | :)

Roger
GeneralRe: Reading text file using ifstream Pin
toxcct6-Dec-05 1:10
toxcct6-Dec-05 1:10 
GeneralRe: Reading text file using ifstream Pin
grero6-Dec-05 1:29
grero6-Dec-05 1:29 
AnswerRe: Reading text file using ifstream Pin
kakan6-Dec-05 0:02
professionalkakan6-Dec-05 0:02 
AnswerRe: Reading text file using ifstream Pin
S. Senthil Kumar6-Dec-05 4:10
S. Senthil Kumar6-Dec-05 4:10 
GeneralRe: Reading text file using ifstream Pin
grero6-Dec-05 8:28
grero6-Dec-05 8:28 
Questionmmx vs. floating point Pin
9ine5-Dec-05 23:38
9ine5-Dec-05 23:38 
AnswerRe: mmx vs. floating point Pin
Chris Losinger6-Dec-05 2:11
professionalChris Losinger6-Dec-05 2:11 
GeneralRe: mmx vs. floating point Pin
9ine6-Dec-05 3:02
9ine6-Dec-05 3:02 
GeneralRe: mmx vs. floating point Pin
Chris Losinger6-Dec-05 4:03
professionalChris Losinger6-Dec-05 4:03 
GeneralRe: mmx vs. floating point Pin
9ine7-Dec-05 3:40
9ine7-Dec-05 3:40 
Questionchanging mouse pointer at button click in vc++ Pin
Member 15877415-Dec-05 23:29
Member 15877415-Dec-05 23:29 
AnswerRe: changing mouse pointer at button click in vc++ Pin
ThatsAlok6-Dec-05 0:48
ThatsAlok6-Dec-05 0:48 
QuestionLPTSTR to float Pin
paper675-Dec-05 23:25
paper675-Dec-05 23:25 
AnswerRe: LPTSTR to float Pin
Cool Ju5-Dec-05 23:36
Cool Ju5-Dec-05 23:36 
GeneralRe: LPTSTR to float Pin
paper675-Dec-05 23:51
paper675-Dec-05 23:51 
GeneralRe: LPTSTR to float Pin
Cool Ju5-Dec-05 23:58
Cool Ju5-Dec-05 23:58 
GeneralRe: LPTSTR to float Pin
paper676-Dec-05 0:08
paper676-Dec-05 0:08 

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.