The code as provided is more appropriate to the C board, not the C++ board here but...
Code:
struct Discos
{
...
};
void ingresar(Dicos& dicos, int& index);
void revisar(Dicos& dicos);
Type names do not match.
If you're gonna post on the C++ board you might as well start using some C++ concepts such as containers and standard console I/O streams (std::cin/std::cout). Start with your Discos struct/container, it should contain information for a single CD and the items should not be arrays since we will only store information for a single CD (I've changed the name to a singular Disco instead of plural Discos):
Code:
struct Disco
{
int cap;
int miliseg;
float cost;
float prec;
char codven;
};
Now your program should have a container (such as a std::vector) to hold all the Disco objects (as many as the user wants to enter). This object should be declared in main and passed into the functions to get/display the data for a given CD:
Code:
#include <vector>
...
int main()
{
std::vector<Disco> discos;
Now, your functions should take a reference to this std::vector container. The ingresar function will push new objects into the vector and passing by reference will preserve changes between function calls to the vector. The revisar function should take a const reference to the vector (since it is not the type of function that will be making changes to the vector).
Code:
void ingresar(std::vector<Disco>&);
void revisar(const std::vector<Disco>&);
int main()
{
...
switch (op)
{
case 1:
{
ingresar(discos);
break;
}
case 2:
{
revisar(discos);
break;
}
...
}
void ingresar(std::vector<Disco>& discos)
{
...
}
void revisar(const std::vector<Disco>& discos)
{
...
}
Now, the ingresar function needs to populate an instance of a Disco object and then push that onto the vector:
Code:
#include <iostream>
...
void ingresar(std::vector<Disco>& discos)
{
Disco temp; // Temp object
std::cout << "\nFavor de ingresar los siguientes datos:\n\n\nCapacidad del disco en byte: ";
std::cin >> temp.cap;
std::cout << "\nTiempo de acceso en milisegundos: ";
std::cin >> temp.miliseg;
std::cout << "\nCodigo del vendedor (A, B, C, D): ";
std::cin >> temp.codven;
std::cout << "\nCosto de fabrica: ";
std::cin >> temp.cost;
std::cout << "\nPrecio de venta al publico: ";
std::cin >> temp.prec;
discos.push_back(temp); // Add the latest Disco object entered by the user to the vector
}
Work from that. Try to do the revisar function yourself. You'll need to iterate over the container with some type of loop and output the data for all Disco objects in the vector.