How do I have a function that takes in any number of arguments then check its data type accordingly? I understand that in java its Objects..arguments then doing instanceof to check the data type, but in C++?
basically something like converting this into C++
public int Testing(String sql, Object...arguments) throws SQLException{
PreparedStatement ps = con.prepareStatement(sql);
for(int i=0; i< arguments.length; i++){
if (arguments[i] instanceof String)
ps.setString(i+1, arguments[i].toString());
else if (arguments[i] instanceof Integer)
ps.setInt(i+1, Integer.parseInt(arguments[i].toString()));
}
return ps.executeUpdate();
}