fork download
  1. #include <iostream>
  2.  
  3. //In your CFG.h file:
  4.  
  5. class CFG
  6. {
  7. public:
  8. std::string code[25];
  9. char startNT;
  10.  
  11. CFG(std::string inCode[], int stringLen);
  12. char getStartNT();
  13. void setStartNT(char stNT);
  14. bool processData(std::string inString, std::string wkString);
  15. void garbage();
  16. };
  17.  
  18.  
  19. //Then in your CFG.cpp file.
  20. CFG::CFG(std::string inCode[], int stringLen)
  21. {
  22. for (int a = 0; a < stringLen; a++)
  23. {
  24. //cout << inCode[a] << endl;
  25. this->code[a] = inCode[a];
  26. }
  27. for (int a = 0; a < stringLen; a++)
  28. {
  29. std::cout << this->code[a] << std::endl;
  30. }
  31. }
  32.  
  33. char CFG::getStartNT()
  34. {
  35. return startNT;
  36. }
  37.  
  38. void CFG::setStartNT(char stNT)
  39. {
  40. startNT = stNT;
  41. }
  42.  
  43. bool CFG::processData(std::string inString, std::string wkString)
  44. {
  45. //Our recursive function
  46. return true;
  47. }
  48.  
  49. void CFG::garbage()
  50. {
  51. return;
  52. }
  53.  
  54.  
  55. //Then in your main file:
  56.  
  57. int main() {
  58. // your code goes here
  59. return 0;
  60. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty