Pelles C forum

Pelles C => General discussions => Topic started by: DXL on November 30, 2004, 11:43:22 AM

Title: find a problem in compiling following program...
Post by: DXL on November 30, 2004, 11:43:22 AM
#include <stdio.h>
#define TEXT "hello"
static char* ptr1=(char*) 0x400040;
static char* ptr2=(char*) 0x400040+sizeof(TEXT)+1;

void main()
{
printf("%s",ptr1);
printf("%s",ptr2);
}

the string "hello" is put in the bins of the exe i got, normally it wouldnt happen!!
how to bypass that?
Title: find a problem in compiling following program...
Post by: Pelle on November 30, 2004, 11:57:49 PM
When you use sizeof, TEXT/"Hello" is referenced and will be emitted. No way around this. If it's easy, I will try to change it - but it has not very high priority...

Pelle