Introduction to C++ arrays

Introduction to C++ arrays 

 C++ arrays

C++ arrays

 

एक array similar type (data type) की values का collection होता है। ये values sequence में होती है और contiguous memory locations (एक के बाद एक series में) में store की जाती है। ये सभी values एक ही नाम से represent और access की जाती है जिसे array का नाम कहते है। Array का नाम आप array declare करते समय define करते है।

Array की size fixed होती है और ये compile time पर (program के run होने से पहले) ही array को declare करते समय define की जाती है। जितनी array की size होती है आप उतने ही elements array में store कर सकते है।         
उदाहरण के लिए आप बहुत से integer numbers एक नाम से store करने के लिए एक integer array create कर सकते है। 

C++ में आप char type के variable में एक बार में एक ही character store कर सकते है। लेकिन मान लीजिये आप किसी व्यक्ति का नाम store करना चाहते है तो आप एक character array create कर सकते है और उसमे आवश्यकता के अनुसार characters store कर सकते है।

 इसी प्रकार आप float type का array बनाकर उसमे float numbers store कर सकते है।

C++ में arrays create करने के 2 steps है।
Declaring an arrayInitializing an array

Share this

Related Posts

Previous
Next Post »

please comment your choice game ...