home > 比較編 > C, C++, Objective-C, Java, C# > primitive types >

ForNext

Only Do What Only You Can Do

010. allocate primitive type on heap

VBScript

JScript

Perl

PHP

Python

Ruby

PowerShell

Scala

F#

C

C++

int *ip = new int;


C++Builder

VC++

C#

object i = 0;


Java

primitive types are always stack allocated. Use a wrapper class to store on the heap:
Integer i = new Integer(0);

Objective-C

#include <stdlib.h>

int *ip = malloc(sizeof(int));

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system