Webhosting in Pakistan
Results 1 to 8 of 8

Thread: Creating an array at runtime

  1. #1
    ithoun is offline Senior Member+
    Last Online
    16th September 2014 @ 06:43 PM
    Join Date
    31 May 2010
    Posts
    176
    Threads
    38
    Credits
    760
    Thanked
    24

    Smile Creating an array at runtime

    Webhosting in Pakistan
    As-salam-o-aliukum................


    \\code
    #include<iostream.h>
    #include<conio.h>
    void main()
    {
    clrscr();
    int* a; // Pointer to int, initialize to nothing.
    int n;
    cout<<"Enter Size of Array 'a'\n"; // Size needed for array
    cin>>n; // Read in the size
    a= new int[n]; // Allocate n ints and save ptr in a.

    getch();
    }

  2. #2
    saadsadig's Avatar
    saadsadig is offline Senior Member+
    Last Online
    16th December 2019 @ 05:19 PM
    Join Date
    17 Feb 2013
    Location
    Punjab
    Age
    28
    Gender
    Male
    Posts
    1,915
    Threads
    106
    Credits
    207
    Thanked
    112

  3. #3
    ithoun is offline Senior Member+
    Last Online
    16th September 2014 @ 06:43 PM
    Join Date
    31 May 2010
    Posts
    176
    Threads
    38
    Credits
    760
    Thanked
    24

    Default

    Quote saadsadig said: View Post
    ???
    is code ki madad say ap array ki length runtime par daay saktay ho..

  4. #4
    Hashmatnaqvi's Avatar
    Hashmatnaqvi is offline Senior Member+
    Last Online
    18th February 2016 @ 01:27 AM
    Join Date
    16 Jan 2012
    Location
    Islamabad
    Age
    26
    Gender
    Male
    Posts
    639
    Threads
    55
    Credits
    0
    Thanked
    105

    Default

    good work bro simple but in detail code
    thanks for sharing
    Shadow xXx

  5. #5
    IT_Love's Avatar
    IT_Love is offline Advance Member
    Last Online
    19th August 2019 @ 08:05 PM
    Join Date
    18 Jun 2011
    Location
    ★★★★
    Age
    25
    Gender
    Male
    Posts
    1,943
    Threads
    120
    Credits
    884
    Thanked
    102

    Default

    Constant expression Requried ka error aata h please koie as ka solution bataye


  6. #6
    MUZAFAR_ALI is offline Senior Member+
    Last Online
    27th July 2019 @ 09:35 PM
    Join Date
    25 Jan 2012
    Location
    QUETTA
    Gender
    Male
    Posts
    199
    Threads
    2
    Credits
    12
    Thanked
    12

    Default

    Nice

  7. #7
    moizkhan123's Avatar
    moizkhan123 is offline Senior Member+
    Last Online
    18th October 2014 @ 02:42 PM
    Join Date
    25 Apr 2013
    Location
    quetta
    Gender
    Male
    Posts
    92
    Threads
    20
    Credits
    0
    Thanked
    3

    Default

    arrays kya hote he muje samajh nhi arahi

  8. #8
    ammarbukhari is offline Senior Member+
    Last Online
    4th September 2015 @ 12:55 PM
    Join Date
    14 Oct 2014
    Location
    D.I.Khan
    Age
    27
    Gender
    Male
    Posts
    34
    Threads
    3
    Credits
    802
    Thanked
    4

    Default

    Webhosting in Pakistan
    collection of same data type.. yani agar aap ko 10 integer variables define karny hain to aap

    int a,b,c,d,e,f,g,.....

    ki bajae..

    int a[10];

    likh kar directly 10 variables declare kar skty hain under a single name..

    faida ye hoga kay aapko mukhtalif variables kay nam yaad rakhny nahi paren gy sirf 1 nam hoga uska jaisa kay uper define hai "a"..

    Quote moizkhan123 said: View Post
    arrays kya hote he muje samajh nhi arahi

Similar Threads

  1. Visual Basic Commands
    By jawadpk in forum English IT Zone
    Replies: 6
    Last Post: 19th August 2013, 02:50 PM
  2. Replies: 14
    Last Post: 31st July 2013, 11:56 AM
  3. Replies: 9
    Last Post: 30th May 2012, 12:47 PM
  4. I am Dua ---- muje help chahiey bohat urgent
    By dua almas in forum Ask an Expert
    Replies: 13
    Last Post: 5th May 2010, 07:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •