Raised This Month: $51 Target: $400
 12% 

Converting 1D array into 2D


Post New Thread Reply   
 
Thread Tools Display Modes
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-14-2017 , 07:10   Re: Converting 1D array into 2D
Reply With Quote #11

if an array is declared as a 1d array, it can`t be made into 2d. you can only create 2d array and pass info to it from 1d one
__________________
retired chump
DjSoftero is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-14-2017 , 10:35   Re: Converting 1D array into 2D
Reply With Quote #12

Quote:
Originally Posted by Abhinash View Post
So, can you tell me the correct way of converting 1D array into 2D ?
What are you trying to do because you cant convert an array from 1d into 2d
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-14-2017 , 16:04   Re: Converting 1D array into 2D
Reply With Quote #13

Maybe this? Assigning 1D array's elements to the 2D array is the only way.
PHP Code:
new szArray33 ], szArray133 ][ 64 ];

for( new 
isizeof szArrayi++ )
{
    for( new 
xsizeof szArray1x++ )
    {
        if( 
sizeof szArray != sizeof szArray1 )
        break;
    
        
szArray1] = szArray];
    }

PS: Both arrays must be the same size.
__________________

Last edited by edon1337; 12-14-2017 at 16:06.
edon1337 is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 12-14-2017 , 16:41   Re: Converting 1D array into 2D
Reply With Quote #14

You gave me the converted code of C++ .
But I want a pawn one .
Abhinash is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-14-2017 , 17:58   Re: Converting 1D array into 2D
Reply With Quote #15

Quote:
Originally Posted by Abhinash View Post
You gave me the converted code of C++ .
But I want a pawn one .
Edon posted Pawn code.
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-15-2017 , 06:16   Re: Converting 1D array into 2D
Reply With Quote #16

Quote:
Originally Posted by Abhinash View Post
You gave me the converted code of C++ .
But I want a pawn one .
This is what the code would look in C++.
PHP Code:
int szArray33 ], int szArray133 ][ 64 ];

for( 
int i=0sizeof szArrayi++ )
{
    for( 
int x=0sizeof szArray1x++ )
    {
        if( 
sizeof szArray != sizeof szArray1 )
        break;
    
        
szArray1] = szArray];
    }

__________________
edon1337 is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 12-15-2017 , 15:55   Re: Converting 1D array into 2D
Reply With Quote #17

I will try and tell you.
Abhinash is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode