Advertisement
Guest User

Untitled

a guest
Sep 18th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # File format
  2. 5 10 # Number of dimensions, size of each dimension
  3. 1 2 3 4 5 6 7 ... # Data
  4.  
  5. int numDim, dimSize;
  6. // Read number of dimensions, size of each dimension
  7. char* data = (char*) malloc(sizeof(char) * numDim * dimSize);
  8.  
  9. for (int i = 0; i < numDim; ++i) {
  10. for (int j = 0; j < dimSize; ++j) {
  11. data[i * dimSize + j] = read character from file;
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement