473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

problem with static char

Hi,

I am facing a problem .

In VS 2006 I have created a win32 static library.

in one of the functions I have declared a variable as

static char path[1000]="\0";

I link this library to another exe.

WHile debugging when control comes on this declaration,

it doesn't identify path.

I tried to copy "path" to watch window but it says symbol not found.

Why is that so.

My OS is windows XP . is it that .net 2005 that was instaleld.

Kindly let me know.

regards

Vijay

Apr 19 '07 #1
4 5498
ya*******@ausi.com wrote:
Hi,

I am facing a problem .

In VS 2006 I have created a win32 static library.

in one of the functions I have declared a variable as

static char path[1000]="\0";

I link this library to another exe.

WHile debugging when control comes on this declaration,
You're probably not in a function where path is in the scope.
The static storage class specifier implies internal linkage.
Contexts outside of that file can't see it.
Apr 19 '07 #2
ya*******@ausi.com wrote:
Hi,

I am facing a problem .

In VS 2006 I have created a win32 static library.

in one of the functions I have declared a variable as

static char path[1000]="\0";

The above construct is deprecated. Put the variable in a
(possibly unnamed) namespace.

Apr 19 '07 #3
Ron Natalie wrote:
ya*******@ausi.com wrote:
>Hi,

I am facing a problem .

In VS 2006 I have created a win32 static library.

in one of the functions I have declared a variable as

static char path[1000]="\0";

The above construct is deprecated. Put the variable in a
(possibly unnamed) namespace.
Twice you posted and it seems twice you missed the fact that
the OP said "in one of the functions ...". The 'path' does
*not* have namespace scope.

The OP's problem is with VC++ debugger, which doesn't have
the ability to identify static local variables.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 19 '07 #4
ya*******@ausi.com wrote:
Hi,

I am facing a problem .

In VS 2006 I have created a win32 static library.
What's VS 2006? Do you mean Visual C++ v6?
in one of the functions I have declared a variable as

static char path[1000]="\0";

I link this library to another exe.

WHile debugging when control comes on this declaration,

it doesn't identify path.

I tried to copy "path" to watch window but it says symbol not found.

Why is that so.
Because VC++ debugger is buggy, most likely.
My OS is windows XP . is it that .net 2005 that was instaleld.
Huh?
Kindly let me know.
The solution is relatively simple. Add another variable

const char (&rpath)[1000] = path;

(right after your 'path'), and use that variable to examine the
contents of the array in the debugger.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Sagar Choudhary | last post by:
I m using a library function which need to be passed a function as parameter. If i declare the function as int (void *, int, char **, char **) it throws an error cannot convert parameter from...
5
by: Ian Stanley | last post by:
Hi, Having not done any C programming for a while I am trying to get back into it by converting an old java assignment into C. The problem is I am getting a segmentation fault at runtime which I...
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
4
by: Jean-Marc | last post by:
Hello all , i have a strange behaviour with this code. File: func.h -------------- #ifndef __FUNC_H__ #define __FUNC_H__ void init_value(void);
1
by: Nikola Milutinovic | last post by:
Hi all. Ran into a minor showstopper. Sometimes, my CC is just too much of a nitpick, but on this matter, I agree with it. "./src/timezone/zic.c" has a mismatch in declaration and definition of...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
9
by: weidongtom | last post by:
Hi, I've written the code that follows, and I use the function add_word(), it seems to work fine *before* increase_arrays() is called that uses realloc() to allocate more memory to words. But...
5
by: YouPoP | last post by:
I have an MFC application (VS2005) with splitter window (one is the view other is a formview). you can select from the main menu different math operation on polynoms and polynoms shows on the...
1
by: elke | last post by:
Hi, I want to use an unmanaged dll in C# .net and I'm having some troubles witch a function that should return an array. I'm new at this, so I don't know what I'm doing wrong. Here is some...
3
Slick47
by: Slick47 | last post by:
Hey guys, I've gone one problem (so far) in my program to be able to assign and display seats. When I compile my program I get the error: SeatAssign.java:54: setSeats(char) in SeatAssign cannot...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.