error expected primary-expression before '' token [closed]

-2

Error on line 21.

#ifndef __STRING_H__
#define __STRING_H__

#pragma warning(disable: 4786)
#include <string>
#include <vector>

const int MAX_RESP = 4;

typedef std::vector<std::string> vstring;


bool isPunc(char c);
void cleanString( std::string &str );
void UpperCase( std::string &str );
void copy(char *array[], vstring &v);

template<typename T>
void shuffle(T &array, size_t size) {
    for(int i = 0; i < size; ++i) {
        int index =() % size;
        std::swap(array[i], array[index]);
    }
}

#endif
    
asked by anonymous 29.05.2016 / 17:59

1 answer

1

I think it was just a typo, since the % operator needs to have two operands, there is only one. The parentheses are there meaningless. Perhaps the intention was to put an expression in there and its result be used as the first operand. Or maybe it's something simpler. I changed () by variable i and compiled, I do not know if it was the intention:

See working on ideone and on CodingGround .

    
29.05.2016 / 18:14