Reading Directory
-
#include
#includeusing std::cin;
using std::cout;
using std::endl;void main()
{
WIN32_FIND_DATA FileDetails;
HANDLE ListDirectory;
ListDirectory = FindFirstFile(L"C:\\*", &FileDetails);
cout << FileDetails.cFileName << endl;
FindClose(ListDirectory);
}I read on MSDN the code is deprecated on Windows 7! Any ideas why it is giving me junk text as a result. Does anyone also know a 1 line fix for the 3 using declarations?
-
#include
#includeusing std::cin;
using std::cout;
using std::endl;void main()
{
WIN32_FIND_DATA FileDetails;
HANDLE ListDirectory;
ListDirectory = FindFirstFile(L"C:\\*", &FileDetails);
cout << FileDetails.cFileName << endl;
FindClose(ListDirectory);
}I read on MSDN the code is deprecated on Windows 7! Any ideas why it is giving me junk text as a result. Does anyone also know a 1 line fix for the 3 using declarations?
-
#include
#includeusing std::cin;
using std::cout;
using std::endl;void main()
{
WIN32_FIND_DATA FileDetails;
HANDLE ListDirectory;
ListDirectory = FindFirstFile(L"C:\\*", &FileDetails);
cout << FileDetails.cFileName << endl;
FindClose(ListDirectory);
}I read on MSDN the code is deprecated on Windows 7! Any ideas why it is giving me junk text as a result. Does anyone also know a 1 line fix for the 3 using declarations?
The
using
keyword is used as follows -#include <iostream>
using namespace std;«_Superman_»
I love work. It gives me something to do between weekends. -
The
using
keyword is used as follows -#include <iostream>
using namespace std;«_Superman_»
I love work. It gives me something to do between weekends. -
It's only used that way if you want to dump the whole of the std:: namespace into your code. You can also use it on individual identifiers (as the original poster did) and to change the visibility of class members. Ash
Fareed Rizkalla wrote:
Does anyone also know a 1 line fix for the 3 using declarations?
This made me think the OP wanted it so.
«_Superman_»
I love work. It gives me something to do between weekends. -
Fareed Rizkalla wrote:
Does anyone also know a 1 line fix for the 3 using declarations?
This made me think the OP wanted it so.
«_Superman_»
I love work. It gives me something to do between weekends.