NO

Author Topic: find a problem in compiling following program...  (Read 2913 times)

DXL

  • Guest
find a problem in compiling following program...
« 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?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
find a problem in compiling following program...
« Reply #1 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
/Pelle