dynamicallocone.cpp

来自「tkugukl.rar c++初学者,指正使用例子」· C++ 代码 · 共 19 行

CPP
19
字号
// This program does not free the memory it allocates.  It is used
// solely to demonstrate the use of the 'new' keyword.

#include <stdio.h>

int *pPointer;

void SomeFunction()
{
	// make pPointer point to a new integer
	pPointer = new int;
	*pPointer = 25;
}

void main()
{
	SomeFunction(); // make pPointer point to something
	printf("Value of *pPointer: %d\n", *pPointer);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?