This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" indendentation specific to file types | |
:filetype plugin indent on | |
filetype plugin on | |
" spaces instead of tabs | |
"set expandtab | |
" show line numbers | |
"set number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from http://www.cplusplus.com/doc/tutorial/files/ | |
// reading a text file | |
#include <iostream> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
int main () { | |
string line; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from: http://www.cplusplus.com/doc/tutorial/files/ | |
// writing a text file | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main () { | |
ofstream myfile ("example.txt"); | |
if (myfile.is_open()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <stdint.h> | |
#include <pcre.h> | |
using namespace std; | |
uint32_t cpufreq() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for_each(foos.begin(), foos.end(), mem_fun(&Foo::doStuff)); | |
// Example ... | |
class Foo | |
{ | |
public: | |
Foo(); | |
void doStuff(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T> | |
class DeleteObj | |
{ | |
public: | |
void operator()(T*obj) { delete obj; } | |
}; | |
// Sample usage ... | |
class Foo |
NewerOlder