Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int soma(int *v1, size_t tam_v1, int *v2, size_t tam_v2, int *v3) {
- if(tam_v1 != tam_v2)
- return 0;
- for(unsigned int i=0; i < tam_V1; i++)
- *v3++ = *v1++ + *v2++;
- return 1;
- }
- int main(void){
- int v1[5] = {1,2,3,4,5};
- int v2[5] = {6,7,8,9,10};
- int v3[5];
- if(soma(v1,5,v2,5,v3) == 1) {
- for(int i=0; i < 5; i++)
- printf("%d\n", v3[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement