load file in buffer
-
hi I'm new to C++ and would like to know how to load a file into a buffer. Is it something like char *buf1 = fopen(??); though that does not seem to work thanks
-
FILE * pf; pf = fopen("C:\\File\\Path\\File.extension" , "R" ); if (pf) { // File well opened // in order to read work on the fread function } if u want to use MFC see the CStdioFile or CFile class Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;
tx for the reply. pf (file in my case) unfortunately does change, but to 0, so the if function isn't entered. The file does exist, cuase I'm using the following code: FILE *file; CFileDialog cf(TRUE); //Get Filename if (cf.DoModal() == IDOK) { CString m_pathname1 = cf.GetPathName(); file=fopen(m_pathname1,"R"); } if (file) { //does not enter here!! } what am I doing wrong?
-
FILE * pf; pf = fopen("C:\\File\\Path\\File.extension" , "R" ); if (pf) { // File well opened // in order to read work on the fread function } if u want to use MFC see the CStdioFile or CFile class Papa Murex Co. while (TRUE) Papa.WillLove ( Bebe ) ;
tx for the reply pf (file in my case) unfortunately does change, but to 0, so the if function isn't entered. The file does exist, cuase I'm using the following code: FILE *file; CFileDialog cf(TRUE); //Get Filename if (cf.DoModal() == IDOK) { CString m_pathname1 = cf.GetPathName(); file=fopen(m_pathname1,"R"); } if (file) { //does not enter here!! } what am I doing wrong?
-
tx for the reply pf (file in my case) unfortunately does change, but to 0, so the if function isn't entered. The file does exist, cuase I'm using the following code: FILE *file; CFileDialog cf(TRUE); //Get Filename if (cf.DoModal() == IDOK) { CString m_pathname1 = cf.GetPathName(); file=fopen(m_pathname1,"R"); } if (file) { //does not enter here!! } what am I doing wrong?