Sorry if there's anything wrong i'm new on this...
I've spent two days trying to find a solution to this error, and i can't seem to find one; so i have to make a menu with switch and split a bunch of numbers from a TXT file but i get an error.
Here's my code:
#include <iostream>
#include <conio.h>
#include "vectores.h"
usingnamespace std;
main()
{
int op,n,vecta[10][1],a=0,vectb[10][1],b=0;
do{
system("cls");
cout<<"Ingrese una opcion:\n\n1. Union de A y B.\n2. Interseccion de A y B.\n3. Diferencia de A y B.\n4. Diferencia de B y A.\n5. Diferencia simetrica de A y B.\n6. Determinar la desviacion estandar de cada uno de los conjuntos.\n7. Determinar la desviacion media de cada uno de los conjuntos.\n8. Determinar la moda de los conjuntos.\n9. Determinar la mediana de los conjuntos.\n10. Generar un archivo con todos los resultados.\n11. Salir. ";
cin>>op;
system("cls");
switch(op)
{
case 1:
cout<<"Opcion 1.\nUnion de A y B";
getch();
break;
case 2:
cout<<"Opcion 2.\nInterseccion de A y B";
getch();
break;
case 3:
cout<<"Opcion 3.\nDiferencia de A y B";
getch();
break;
case 4:
cout<<"Opcion 4.\nDiferencia de B y A";
getch();
break;
case 5:
cout<<"Opcion 5.\nDiferencia simetrica de A y B";
getch();
break;
case 6:
cout<<"Opcion 6.\nDesviacion estandar de cada uno de los conjuntos";
getch();
break;
case 7:
cout<<"Opcion 7.\nDesviacion media de cada uno de los conjuntos";
getch();
break;
case 8:
cout<<"Opcion 8.\nModa de los conjuntos";
getch();
break;
case 9:
cout<<"Opcion 9.\nMediana de los conjuntos";
getch();
break;
case 10:
cout<<"Opcion 10.\nGenerar archivo con los resultados";
getch();
break;
case 11:
break;
default:
cout<<"Opcion invalida\n";
system("pause");
}
}while(op!=11);
getch();
}
and here is the errors im getting from it:
[Error] redefinition of 'int main()'
[Error] 'int main()' previously defined here
Please, i need help i don't know what i've done wrong.
Ps:Sorry for my english...
EDIT
In the include at the begining where it says "vectores.h", it a library i tried to create but can't seem to make it work on the code; anyway, here is the code from de library:
So how do i fix it; i mean do i have to change something in the library i tried to create?
also i've puutted int before main as you said, but the error seem to be showing again
Learn what header files are for, or at least spend a small amount of effort and try to figure it out. What you are trying to do is completely wrong, which you will see by looking at the first result from that link. There is no simple way to change what you have and make it right. I apologize if that sounds harsh, but the link I posted will give you all the answers you need. If there is something you cannot figure out from any of that, then ask a specific question. If you cannot narrow it down more than that, it is too far over your head, and you should concentrate on simpler concepts before moving on, and stick to single file programs for now. I am not trying to discourage you, but you do need to learn how to crawl, before you can walk.