Advertisement
TheFastFish

help me

Apr 19th, 2015
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. class MODSampleData {
  6. private:
  7.     int Tune;
  8.     int Volume;
  9. } MODSampleData;
  10.  
  11. class MODSample {
  12. private:
  13.     char SampleName [23];
  14.     int SampleLength;
  15.     MODSampleData * SampleData;
  16.  
  17. } MODSample;
  18.  
  19. class MODFile {
  20. private:
  21.     char MODName [21];
  22.     char Filepath;
  23.     int ChannelCount;
  24.     int SampleCount;
  25.     int PatternCount;
  26.     int PatternSequence [128];
  27.     int SongLength;
  28.     MODSample Samples [31];
  29. public:
  30.     MODFile();
  31.     void LoadFile(char fpath) {
  32.         int i;
  33.         Filepath = fpath;
  34.         fstream myMOD;
  35.         myMOD.open(&fpath, ios::in | ios::binary);
  36.         //read in song name
  37.         myMOD.read(MODName, 20);
  38.         MODName[20] = '\0';
  39.         //read in all 31 samples
  40.         //samples are a class MODSample (see below)
  41.         for (i = 0; i < 31; i++) {
  42.             myMOD.read(Samples[0].SampleName, 22);
  43.             Samples[0].SampleName[22] = '\0';
  44.         };
  45.     };
  46. } MODFile;
  47.  
  48. 1>------ Build started: Project: MODFile, Configuration: Debug Win32 ------
  49. 1>  mod.cpp
  50. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(15): error C2143: syntax error : missing ';' before '*'
  51. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  52. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  53. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(28): error C2146: syntax error : missing ';' before identifier 'Samples'
  54. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(28): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  55. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(28): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  56. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(42): error C2065: 'Samples' : undeclared identifier
  57. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(42): error C2228: left of '.SampleName' must have class/struct/union
  58. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(43): error C2065: 'Samples' : undeclared identifier
  59. 1>c:\documents and settings\alex\my documents\visual studio 2010\projects\sdltest\sdltest\mod.cpp(43): error C2228: left of '.SampleName' must have class/struct/union
  60. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement