Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout << "Current genre is: " << arr[pos].genre << endl;
- forceChange(arr,pos,typeof(arr[pos].genre));
- // часть в которой я пытаюсь вызвать функцию, и где она гурается на
- // Expected '(' for function-style cast or type construction
- // сама функция
- template <typename T, typename Y> // мне очень сложно понять как запихнуть в эту функцию тип
- void forceChange (T *&arr, int pos, Y)
- {
- cout << "Please insert y if you wish to change it or leave it empty" << endl;
- string yString;
- cin >> yString;
- if(yString == "y")
- {
- Y newValue;
- cout << "Please insert a new parameter!" << endl;
- cin >> newValue;
- arr[pos].Y = newValue;
- }
- else return;
- }
Advertisement
Add Comment
Please, Sign In to add comment