| | |
formated file reading problem
![]() |
•
•
Join Date: Jan 2008
Posts: 119
Reputation:
Solved Threads: 10
As i knew the <stdarg.h> header should have the following function
int vfscanf(FILE *stream, const char *format, va_list ap);
but under Visual Studio 2005, after including the header and calling the function i get
'vfscanf': identifier not found
if the function is not declared, can u tell me some simmilar functions that do the same
thing and have the same parameters?
thx
int vfscanf(FILE *stream, const char *format, va_list ap);
but under Visual Studio 2005, after including the header and calling the function i get
'vfscanf': identifier not found
if the function is not declared, can u tell me some simmilar functions that do the same
thing and have the same parameters?
thx
•
•
Join Date: Jan 2008
Posts: 119
Reputation:
Solved Threads: 10
•
•
•
•
I don't think it is supported. A replacement might be fscanf() + some extra code, but it really depends on what you are doing with with vfscanf.
what i want to is to have a Scan method in my File class that looks like
void File:
can ( const char * Format, ... ) {
va_list objArgs;
va_start( objArgs, pcFormat );
vfscanf( m_pFile, pcFormat, objArgs ); // m_pFile is the file handle
va_end( objArgs );
}
this is actually wraping fscanf in File:
can Did some research for you, and there is a workaround :
Just throw that in the file where you're using vsscanf and it should work again.
If you use this code, use the vsscanf_s instead of the vsscanf if you want to avoid getting anoying "sscanf was declared deprecated" warnings.
Hope this helps. If it doesn't, post some sample data from your file and you'll get advice how to make your own function for it.
Niek
c Syntax (Toggle Plain Text)
#ifndef __stdio_h__ #include <stdio.h> #define __stdio_h__ #endif int vsscanf_s (const char * src, const size_t length, const char * format, va_list argList); int vsscanf_s (const char * src, const size_t length, const char * format, va_list argList) { return _snscanf_s (src, length, format, * (void **) argList); } int vsscanf (const char * src, const char * format, va_list argList); int vsscanf (const char * src, const char * format, va_list argList) { return sscanf (src, format, * (void **) argList); }
If you use this code, use the vsscanf_s instead of the vsscanf if you want to avoid getting anoying "sscanf was declared deprecated" warnings.
Hope this helps. If it doesn't, post some sample data from your file and you'll get advice how to make your own function for it.
Niek
![]() |
Similar Threads
Other Threads in the C++ Forum
- Previous Thread: Trying to learn from error messages(general error c10100b1)
- Next Thread: classes and inheritance problems
| Thread Tools | Search this Thread |
api array based binary bitmap build c++ c++intmain() c/c++ char class classes client code coding compile console conversion copyanyfile count counttheoccurenceofanintegerinthe10inputs delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption environment error file forms fstream function functions game givemetehcodez graph gui homeworkassignment homeworkhelp homeworkhelper i/o iamthwee ifstream input int integer java jni lib linkedlist linker loop looping loops map math matrix memory multiple multipledimensionarray news node numbers output pointer problem program programming project python radix random read recursion reference rpg string strings temperature template test text text-file tree url variable vector video vtk win32 windows winsock wordfrequency wxwidgets






)
