a few doubts!
- From: "maadhuu" <madhu_ranjan_m@xxxxxxxxx>
- Date: Sat, 30 Apr 2005 09:09:35 -0400
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char * a= "bcd";
clrscr();
strcpy(a,"hello");
a = "fgh";
a[0] = 't';
printf("%s",a);
}
now, in TC there is absolutely no error .....i thought it
should........coz' when i declare a as a char * and assign it to some
string then it should be a constant and cannot do things like a[0] = '4'
and stuff........infact the entire thing here works properly....so why
should it work properly??
.
- Follow-Ups:
- Re: a few doubts!
- From: SM Ryan
- Re: a few doubts!
- From: Emmanuel Delahaye
- Re: a few doubts!
- From: Flash Gordon
- Re: a few doubts!
- From: Lew Pitcher
- Re: a few doubts!
- Prev by Date: Re: Using define with variable values
- Next by Date: Re: main(int argc, char *argv[])
- Previous by thread: Using define with variable values
- Next by thread: Re: a few doubts!
- Index(es):