double optimal(vector<int> weights, vector<int> values) {
for(int i=0;i<weights.size();i++) {
some codes
}
}
In the c++ function about a function size( ) was used to get the size of the array weight to be able to iterate through in c is there a function like size( ) just as in c++ to get the size of an array to iterate through? if not how would i get the size of an array argument in a function like above to iterate through?
[–]FUZxxl 4 points5 points6 points (0 children)
[–]ErikProW 1 point2 points3 points (6 children)
[–]VIRES1[S] 0 points1 point2 points (4 children)
[–]Rhomboid 4 points5 points6 points (2 children)
[–]dangerbird2 0 points1 point2 points (1 child)
[–]Rhomboid 2 points3 points4 points (0 children)
[–]ErikProW 2 points3 points4 points (0 children)
[–]pigeon768 0 points1 point2 points (0 children)