
// Win32-Konsolenprojekt Debuggen/ Starten ohne Debuggen

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>


/***** Result listing *******************************************


 Pointer-Proof / Zeiger-Beweis


 Case, you too have sometimes problems with pointers, than read this.


 Preface:

 If we inspect the term:

 (eq.0) int * a, b;

 we find sign * must be connected to variable a
 because variable b becomes no pointer.


 Proof:

 Let's inspect a memory cell with content and address (&content):

 (eq.1)  content = 8080
 (eq.2) &content = 0018FE9C

 and let us introduce a pointer with memory cell address:

 (eq.3) int *pointer = &content;

 (eq.4) &pointer = 0018FE90
 (eq.5)  pointer = 0018FE9C
 (eq.6) *pointer = 8080         (de-reference)

 We find the deref. pointer equal to the content of our memory cell:

 (eq.7) *pointer = content;

        *pointer = 8080; content = 8080;


 But setting (3) into (7) we find:

 (eq.8) &content = content;

 (eq.9) Test:
   &content = 0018FE9C;  content = 8080;

 Sorry, &content is different to content!


 Conclusion:
 C/C++ shows an antagonism.

 1. interpretation:
 The content of the memory cell is equal the address of the cell: wrong.

 2. interpretation:
 eq.0 is controversial to eq.3.

 3. interpretation:
 C-developers did not know the meaning of the mathematical equal (=) sign.

 However, the pointer-approach in C is controversial.
 C needs urgent a reconstruction.

 Der Inhalt der Speicherzelle ist gleich ihrer Adresse.
 Der Zeiger-Ansatz von C ist in sich widerspruechlich.


 Compiled with Microsoft Visual C++ .NET V.7.1.3088
 Source http://www.gfai.de/~heinz/techdocs/index.htm
 G. Heinz, 5.11.2012

*****************************************************************/



void main(void) 
{
	printf("\n\n\n Pointer-Proof / Zeiger-Beweis\n\n\n");
	printf(" Case, you too have sometimes problems with pointers, than read this.\n\n\n");

	printf(" Preface: \n\n If we inspect the term: \n\n (eq.0) int * a, b; \n\n");
	printf(" we find sign * must be connected to variable a \n");
	printf(" because variable b becomes no pointer.\n\n\n");

	printf(" Proof: \n\n Let's inspect a memory cell with content and address (&content):\n\n");
    int content = 8080;
	printf(" (eq.1)  content = %d\n", content);
	printf(" (eq.2) &content = %p\n", &content);

	// Pointer auf pointer bekommt Adresse von content:
	printf("\n and let us introduce a pointer with memory cell address:\n\n (eq.3) int *pointer = &content; \n\n"); 
	int *pointer = &content; 

	printf(" (eq.4) &pointer = %p \n", &pointer);
	printf(" (eq.5)  pointer = %p \n", pointer);
	printf(" (eq.6) *pointer = %d  \t(de-reference)\n", *pointer);
	
	printf("\n We find the deref. pointer equal to the content of our memory cell:\n");
	printf("\n (eq.7) *pointer = content;  \n\n        *pointer = %d; content = %d; \n\n", *pointer, content);
	printf("\n But setting (3) into (7) we find:\n\n (eq.8) &content = content;\n");
	printf("\n (eq.9) Test: \n   &content = %p;  content = %d; \n", &content, content);
	printf("\n Sorry, &content is different to content!\n\n\n");

	printf(" Conclusion: \n");
	printf(" C/C++ shows an antagonism. \n\n");

	printf(" 1. interpretation:\n");
	printf(" The content of the memory cell is equal the address of the cell: wrong.\n\n");
	printf(" 2. interpretation: \n eq.0 is controversial to eq.3. \n\n");
	printf(" 3. interpretation: \n C-developers did not know the meaning of the mathematical equal (=) sign. \n\n");
	printf(" However, the pointer-approach in C is controversial. \n C needs urgent a reconstruction. \n\n");
	printf(" Der Inhalt der Speicherzelle ist gleich ihrer Adresse.\n");
	printf(" Der Zeiger-Ansatz von C ist in sich widerspruechlich. \n\n\n");
   	printf(" Compiled with Microsoft Visual C++ .NET V.7.1.3088\n");
   	printf(" Source http://www.gfai.de/~heinz/techdocs/index.htm \n G. Heinz, 5.11.2012 \n\n");

	getchar();
}


