Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
RHCSA, RHCE, AWS, Docker, Kubernetes Training
Sanjeewani95
Updated:
Tuesday at 10:28 AM
🛡️ Kaspersky Antivirus – 1 Year / 1 Device | Rs. 2,300 | Only 9 Left
KSPathirana
Updated:
Monday at 2:42 PM
Ad icon
Professional CCTV Installation Service
Techguy231
Updated:
Sunday at 10:50 AM
Ad icon
I'll research & write an article - Rs. 2000 onwards
Blogerwiki
Updated:
Sep 3, 2026
House Plan
lenura
Updated:
Sep 2, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Problems and Troubleshooting
C++ Help for Array
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="slreverersetuts" data-source="post: 15931631" data-attributes="member: 456929"><p>simply u can use vector with STL.but it is not a part of pure c++ it is a pre written code for that can use for sizable arrays.also u can do with pure c++ with dianamic memory allocations and pointers.the simple idea is if the size is not enough create a array that have previous array's size+1 size and copy all the array in to the newly created array.and ready to get new input.the code get some loops and functions.OR simply u can write...</p><p></p><p><strong>#include <iostream></strong></p><p><strong>usning namespace std;</strong></p><p><strong>int main ()</strong></p><p><strong>{</strong></p><p><strong>int count = 0;</strong></p><p><strong>cout << "enter the size of array : ";</strong></p><p><strong>cin >> count;</strong></p><p><strong>int array[count];</strong></p><p><strong>for (int i = 0; i < count; ++i)</strong></p><p><strong>{</strong></p><p><strong> cout << "enter a value to insert to the array : ";</strong></p><p><strong> cin >> array<em>;</em></strong></p><p><strong><em> cout << "inserted to the array !"<<endl;</em></strong></p><p><strong><em>}</em></strong></p><p><strong><em>return 0;</em></strong></p><p><strong><em>}</em></strong></p></blockquote><p></p>
[QUOTE="slreverersetuts, post: 15931631, member: 456929"] simply u can use vector with STL.but it is not a part of pure c++ it is a pre written code for that can use for sizable arrays.also u can do with pure c++ with dianamic memory allocations and pointers.the simple idea is if the size is not enough create a array that have previous array's size+1 size and copy all the array in to the newly created array.and ready to get new input.the code get some loops and functions.OR simply u can write... [B]#include <iostream> usning namespace std; int main () { int count = 0; cout << "enter the size of array : "; cin >> count; int array[count]; for (int i = 0; i < count; ++i) { cout << "enter a value to insert to the array : "; cin >> array[i]; cout << "inserted to the array !"<<endl; } return 0; }[/i][/B][i][/i] [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom