| | |
Dynamic array
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Snippets out of context don't receive real answers.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
I can't compile your previous code and run it. If you could actually post the current code that demonstrates the issue you are facing, it would expedite the most correct answer.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Ok, here's the full code.
I have attached the binary file as well.
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <fstream> #include <limits> #include <bitset> using namespace std ; int main() { ofstream filebin ; filebin.open("RecordBinaryData.txt") ; ifstream file ( "path to binary file" ) ; file >> noskipws ; typedef bitset< numeric_limits<unsigned char>::digits > bitset ; unsigned char byte ; long count = 0 ; if(filebin.is_open()) { while( file >> byte ) { //cout << bitset(byte) ; // to print bits as it is filebin << bitset(byte) ; count ++ ; } const long const_count = count ; long arr[const_count] ; filebin.close() ; } else { cout << "Unable to open the file.\n" ; } cin.get() ; return 0 ; }
I have attached the binary file as well.
![]() |
Similar Threads
- get length of a dynamic array (C++)
- Sorting 2D Dynamic array of integers , Snake Style (C)
- works for static need help to make it dynamic (C++)
- dynamic array of structures problem (C++)
Other Threads in the C++ Forum
- Previous Thread: passing arrays / updating object arrays
- Next Thread: using if-else
Views: 4040 | Replies: 33
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll dynamic encryption error file forms fstream function functions game givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort stream string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






