How to print an array with brackets around it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to print an array with brackets around it?

I will print an array but want to show ā€œ[ ]ā€ in Cpp, how can I try to do it?

22nd Jun 2020, 3:42 PM
DParlo
DParlo - avatar
3 Answers
+ 2
Iā€™m doing a for loop and put a ā€œvertical lineā€ (before and after the array) like ā€œlā€. But I was wondering if I can connect it or do it more aesthetic
22nd Jun 2020, 4:00 PM
DParlo
DParlo - avatar
+ 2
Can you post your code for see if I can help you?
22nd Jun 2020, 4:03 PM
Emanuel MaliaƱo
Emanuel MaliaƱo - avatar
+ 1
Do you try to do something to achieve that?
22nd Jun 2020, 3:58 PM
Emanuel MaliaƱo
Emanuel MaliaƱo - avatar