Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
13
Добавлен:
17.04.2015
Размер:
512 б
Скачать
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

#define N 10             // Будем исследовать 20 ячеек памяти - 10 вверх и 10 вниз

int main()
{
	char c = 'V';
	char* pointer = &c;       
	char* pointer1 = &c;

	printf("c = %c; adress of c is %p\n",c,&c);

	pointer++;
	pointer1--;
	printf("offset\tLeft\tRight\n");
	for(int i = 0;i < N;i++)
	{
		printf("%d:\t%c(%d)\t%c(%d)\n",i+1,*pointer,*pointer,*pointer1,*pointer1);
		pointer++;
		pointer1--;
	}
	getch();
	return 0;
}
Соседние файлы в папке Сорокин