Use structure to copy at one go without looping.
Something like this:

[code=c++]
struct Phrase {
char phrase[50];
};

Phrase codePhrase, inputPhrase;

cout << "Please input your code without spaces: ";
cin >> inputPhrase.phrase;

// Now copy it to your codePhrase
codePhrase = inputPhrase;
[/code]

WaltP commented: Worthless. Doesn't answer any question asked. -4

[QUOTE=konata_89;1174242]that what im try but don't know la[/QUOTE]

No you are not. I haven't seen any loop in function list_buy_item().

Can you put your effort right here.

check your code for list_item() function where you are looping through all items in newptr. apply same logic to loop in newptr2 and add items.

any luck up till now

<deleted> Posted in wrong thread

Here is simple Digital Clock coded in C++ and compiler used is TurboC.

A class DIGIT is designed to draw digits. Follwoing are the details for this class:

Consructor: DIDGT(); for default settings
DIGITE(int s,int c,int st); for user define settings
s -> is size of the digit
c -> color of the digit
st -> fill style of the digit

Methods: void DIGITE::DrawDig(int x,int y,int n)
x,y -> x and y coordinates of the screen
n -> interge value (<10) to be display

                void DIGITE::PutDig(int x,int y,int n)
                x,y  -> x and y coordinates of the screen
               n  -> interge value (<100) to be display

              void DIGITE::MakeBars()
               internal function used to draw horizontal and vertical    bars for the digits in the memory.

thats it!

Appreciated!
Thanks to all.

[QUOTE=serkan sendur;952373]wow i have created big javascript applications so far and yet i have never needed to delete something from memory. why do you need it?[/QUOTE]

We usually encounter this problem when working with embedded devices (settop boxes etc.) where there is very less memory. We need to free memory where ever its possible.

Thanks gentlemen,

So, using 'delete' OR '[]' will delete all the items (and memory) associated with the array.

Please confirm this.

Hi all,

I want help from all you wonderful guys. I want to know how can we free memory occupied by an Array. That means all the elements associated with this array should be deleted.

let say:

[code='javascript']
var bigArray = ["313123", "123123", "sadasd",.........................];
[/code]

So which will be the best and assured way :

1) [code='javascript'] delete bigArray; [/code]
OR
2) [code='javascript'] bigArray = []; [/code]
OR
3) any other ...

Thanks,

Correction:

[code='c']
for(i = 0; i < row; i++)
[/code]

jephthah commented: 2 months dead, and you bring it up for a typo? -2

hey welcome,

Stick to Web Development forums. You will get lots of good and helpful people there.

BEST OF LUCK!!