Created
October 11, 2018 02:34
-
-
Save chessai/56f24aebeeaf0ffc493f052783685346 to your computer and use it in GitHub Desktop.
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 <stdlib.h> | |
#include <fstream> | |
#include <string> | |
#include <stdio.h> | |
#include <cstring> | |
int main () | |
{ | |
std::ifstream in("infile.txt"); | |
std::string contents((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>()); | |
char * nutt = new char [contents.length() + 1]; | |
std:: strcpy (nutt, contents.c_str()); | |
for(int i = 0; i < contents.length(); i++) | |
{ | |
std::cout << nutt[i]; | |
} | |
// std::cout << nutt.length(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment