how can i determine the size?
#include <iostream>
#include <cctype>
using namespace std;
struct inventory_items
{
int code,quantity,reorder_level;
char name[20], item[3];
double price;
};
inventory_items record[2000];
Question: What should I do to allow the user to enter the size of the array for inventory_items record himself instead of me specifying the size? Thanks!
Re: how can i determine the size?
Quote:
Originally posted by Mingzhi
Question: What should I do to allow the user to enter the size of the array for inventory_items record himself instead of me specifying the size? Thanks!
use std::vector
Code:
#include <vector>
...
std::vector<inventory_items> itemVec;