how do u append and subtract a number in an array. i have no clue. any links to a site about this wouls greatly appreciated
tyczj 0 Junior Poster in Training
Recommended Answers
Jump to PostSee Arrays
Jump to PostTry using the std::vector template class.
std::vector<int> my_int_array; //Add elements my_int_array.push_back(10): my_int_array.push_back(2): //Display all the numbers for(int i=0;i<my_int_array.size();i++) { cout<<my_int_array[i]; } //Deletion of position i :P my_int_array.erase(&my_int_array[i-1],&my_int_array[i]);
If you can only use pure arrays, then you will have to learn about dynamic memory allocation to modify the …
All 8 Replies
tyczj 0 Junior Poster in Training
SpS 34 Posting Pro
tyczj 0 Junior Poster in Training
SpS 34 Posting Pro
FireNet 64 Posting Whiz in Training
tyczj 0 Junior Poster in Training
SpS 34 Posting Pro
tyczj 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.