-1
By the time the input is all ok with the information, but in the output only gives the result 0 and do not know what else to do, already I moved and I reworked the whole code.
The idea is that in a array size 6, the internal sum of these elements occurs. In this case the elements are {1,2,3,4,10,11}
.
int simpleArraySum(int ar_count, int ar [6]) {
ar_count = 0;
ar [0]= 1 ;
ar [1]= 2;
ar [2]= 3;
ar [3]= 4;
ar [4]= 10;
ar [5]= 11;
int i ;
int result;
for (i=0; i<6; i++){
ar_count += ar[i];
};
result = ar_count;
return 0;
}
Yeah, it’s cleaner that way, but then in case he doesn’t recognize the vector... The idea I had up there was to declare every composition of the vector exactly because it didn’t read when I declared inside the keys. main.cpp: In Function 'int main()': main.cpp:15:60: error: taking address of Temporary array This was the error that appeared to me when I played the compiler. I just copied, pasted and ran and gave this error. I don’t know why it doesn’t read the vector in keys.
– Caroldf
If you’re doing something in C because you have one
.cpp
? You clicked on links and saw working?– Maniero
Hm...I selected wrong when opening Dev-c++, thanks man! It helped a lot :)
– Caroldf