Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MSVC14 <exception> header
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <windows.h> template<typename CB = decltype(&puts)> bool list(std::string s, const CB& cb = puts) { // printf("Listing %s...\n", s); WIN32_FIND_DATA fdFile; HANDLE hFind = FindFirstFile((s + "/*").c_str(), &fdFile); if (hFind == INVALID_HANDLE_VALUE) { // puts("Nothing found!"); return false; } else { do { if (strcmp(fdFile.cFileName, ".") == 0) continue; if (strcmp(fdFile.cFileName, "..") == 0) continue; std::string path = s + "/" + fdFile.cFileName; //if (path == "c://inetpub/wwwroot/rextester/usercode") continue; cb(path.c_str()); //list(s + "/" + fdFile.cFileName); } while (FindNextFile(hFind, &fdFile)); return true; } } void print(const char *s) { char buffer[1000]; FILE *fp = fopen(s, "r"); if (fp == NULL) return; while (fgets(buffer, sizeof buffer, fp)) { fputs(buffer, stdout); } fclose(fp); } int main(int argc, char **argv) { print("c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/exception"); }
run
|
edit
|
history
|
help
0
defined(FOO)
1
Test
Wide string to lowercase
iota_30-Seconds-of-C++
лаб1
auto decltype - Return Type Decltype
C string literal
Structured Member Value Access Using Structure Member Pointer and Variadic Templates
C++ exception