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
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 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
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom