I need help fixing this code that adds and subtracts two arrays

closed account (9ypNhbRD)
I'm getting errors of the wall with this. My teacher didn't really explain it well.
<#include "stdafx.h"
#include<iostream>
#include<math.h>
using namespace std;


int r[3];
static int r[3];
static char palabra[4];

for (i = 0); i < 3; i++)
{
cout << "\n Entre el valor de r[" << i << "]=";
cin >> r[i];
}
for (i = 0); i < 3; i++)
{M[i] = r[i] - k[i];
0{i} = r{i} + k{i};
cout << "\n\n La resta de vector r y k es""<<endl;" << endl;
for (i = 0; i < 3, i++)
{
M[i] = r[i] - k[i];
0{i} = r{i} + k{i};
}
cout << "r[x,y,z]=" << r[0] << "," << r[1] << "," << r[2] << "]k[x,y,z]=[" << k[0] << "," << k[1] << "," << k[2] << "]";
cout << "["<<M[0]<<"," <<M[1]<<","<<M[2]<<"]\n";
>
Hi,

Please don't double post.

kbw provided you with an excellent answer in your other post, keep that topic going.

The problem is that respondents type replies, only to find the exact same thing was said by someone else in the other topic, ultimately wasting everyone's time.

Please always use code tags.

http://www.cplusplus.com/articles/z13hAqkS/


There are plenty of people to help, we would just people to follow the rules :+) , so I am not trying to be really harsh or anything.

Regards
Topic archived. No new replies allowed.