## coded_hitec -5

Gentlemen,
Is it possible to initialize the array at the time of creation??
I mean:

int *a = new int[10]; // here array is only created. I wanna initialize the same too here itself. Is it possible???

## finito 46

Why neg him, he is learning. WTF.

int a [10]= [1,2,3,8,7,19,15,555,1024,12458]

Peace

## jonsca 1,059

WTF

Read the comment. He had tacked this onto another thread. It was assessed in that thread and after that it was split off by a moderator.

## finito 46

I don't see no comment, but ok that explains it nice sig btw.

## Nick Evan 4,005

I don't see no comment

You click the : "Add and View Reputation Comments" link next to the orange dot to see the reputation comment.
And Jonsca is right. This post was originally piggybacked on another thread when I split it.

@coded_hitec: With what values do you want to "initialize" the array?

commented: Got it all squared away over PM :) +4

## coded_hitec -5

Why neg him, he is learning. WTF.

int a [10]= [1,2,3,8,7,19,15,555,1024,12458]

Peace

Sir,
I am asking is it possible to initialize a array which is created dynamically using new operator

## Nick Evan 4,005

Again: Initialize with what?

## finito 46

umm? sorry u need to use curly brackets

int *a = {1,2,3,8,7,19,15,555,1024,12458}

you can substitute the values with variables.

My C++ is rather old but this should work.

## mitrmkar 1,056

>> My C++ is rather old but this should work.
Sorry but that will not work either. Consider compiling the code that you post. Even if you are posting minimal snippets/one-liners.

## Banfa 597

@coded_hitec I believe the answer to your question is "no" but I would be happy to be corrected.

## coded_hitec -5

Yeah,
I checked it out at various sources and the answer is no only