Created
January 13, 2017 18:35
-
-
Save stackprogramer/318dc02af7df83cfe1664596dcebd1ac to your computer and use it in GitHub Desktop.
convert int8_t array to binary file, you can see binary file with wxHexEditor,C++
This file contains 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 <iostream> | |
#include"sajad_Math_lab" | |
#include <stdint.h> | |
#include <stdio.h> | |
using namespace std; | |
int main (int argc, char* argv[]){ | |
const char* FILENAM = "a.txt"; | |
int8_t toStore[45]={1,2,3,4,5}; | |
ofstream o(FILENAM,ios::binary); | |
for(int i;i<10;i++) | |
{ | |
o.write((char*)toStore,sizeof(toStore)); | |
o.close(); | |
} | |
ifstream i(FILENAM,ios::binary); | |
//i.read((char*)&toRestore,sizeof(toRestore)); | |
//cout << toRestore << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment