define the variable if u wanna remove the error :P
On Wed, Aug 31, 2011 at 8:26 PM, Rajesh Kumar testalgori...@gmail.comwrote:
What we do to remove error??
#includestdio.h
extern int var;
main()
{
var=10;
return 0;
}
Regards
Rajesh Kumar
--
You received this message because you
@Rahul : I have also mentioned that for the linker error.
You can place a definition int var; after main(), it will work.
Sanju
:)
On Wed, Aug 31, 2011 at 11:14 AM, rahul vatsa vatsa.ra...@gmail.com wrote:
@sanju, if u declare a variable with extern, at compile time its defn is
nt looked
ya thats rt.
On Thu, Sep 1, 2011 at 4:30 AM, Sanjay Rajpal srn...@gmail.com wrote:
@Rahul : I have also mentioned that for the linker error.
You can place a definition int var; after main(), it will work.
Sanju
:)
On Wed, Aug 31, 2011 at 11:14 AM, rahul vatsa vatsa.ra...@gmail.comwrote:
extern try to find the definition of variable var but not able to find so
gives the error
On Wed, Aug 31, 2011 at 8:26 PM, Rajesh Kumar testalgori...@gmail.comwrote:
What we do to remove error??
#includestdio.h
extern int var;
main()
{
var=10;
return 0;
}
Regards
Rajesh Kumar
--
u hv just declared the variable and not defined it.So no memory is allocated
to var. so u l get the undefined reference error.
either remove extern or define new local variable int var =10;
Ashima
M.Sc.(Tech)Information Systems
4th year
BITS Pilani
Rajasthan
On Wed, Aug 31, 2011 at 7:56 AM,
Linker error, failed to find symbol 'var'.
Sanju
:)
On Wed, Aug 31, 2011 at 8:25 AM, rahul sharma rahul23111...@gmail.comwrote:
but it is defined inside mainu mean to say for varibale to be gloabal
it must be defines outsyd all fxns??
On Wed, Aug 31, 2011 at 8:35 PM, Ashima .
but it is defined inside mainu mean to say for varibale to be gloabal it
must be defines outsyd all fxns??
On Wed, Aug 31, 2011 at 8:35 PM, Ashima . ashima.b...@gmail.com wrote:
u hv just declared the variable and not defined it.So no memory is
allocated to var. so u l get the undefined
@sanju, if u declare a variable with extern, at compile time its defn is nt
looked for, rather @ link time corresponding defn is looked for by the
linker. nd if the defn is nt ther, it will raise a linker error, as in case
of this prog
@rahul, ya off course, for a variable to be global it hs to
Variable start and hex_buf point to string constant, which can not be
modified.
Change:
char *start = 12.12.12.12.12976665176069214;
char *hex_buf = 65003a0a;
to:
char start[] = 12.12.12.12.12976665176069214;
char hex_buf[] = 65003a0a;
On 2011-2-15 15:01, dinesh bansal
here start is pointing to string constant which is created in read-only
memory which can't be changed.so modifying it in the for loop causes
segmentation fault
declare it as a array type
On Tue, Feb 15, 2011 at 12:36 PM, rahul rahulr...@gmail.com wrote:
char *start is const char *start, pointer
got it clear.. thanks guys.
On Tue, Feb 15, 2011 at 1:46 PM, jagannath prasad das
jpdasi...@gmail.comwrote:
here start is pointing to string constant which is created in read-only
memory which can't be changed.so modifying it in the for loop causes
segmentation fault
declare it as a array
Hi All,
Can you please point me to the error in the following function. It gives
segmentation fault.
int main()
{
char *start = 12.12.12.12.12976665176069214;
char *hex_buf = 65003a0a;
unsigned short i, j = 0;
int new_len2 = strlen(hex_buf);
for (i = 0; ((j+1) new_len2);
char *start is const char *start, pointer to const char, u can't derefernce
it and change it.
take a char start[256].try this.
On Tue, Feb 15, 2011 at 12:31 PM, dinesh bansal bansal...@gmail.com wrote:
Hi All,
Can you please point me to the error in the following function. It gives
13 matches
Mail list logo