I made this program, but not getting the desired result. Please suggest how to proceed.
#include
#include
#include <wchar.h>
using namespace std;
int main(int argc, char *argv[]) {
wchar_t temp[10] = L"123456789";
int tempDest[50];
cout<<tempDest<<endl;
wchar_t format[4] = L"%d";
//I want to convert string in temp as format specified
int i = swscanf(temp, format, tempDest);
cout<<tempDest<<endl;
cout<<endl<<i<<endl;
return EXIT_SUCCESS;
}
This is the output-
80478c0 // data of tempDest before call to swscanf
80478c0 // data of tempDest after call to swscanf
Welcome to the QNX Momentics IDE
1