473,408 Members | 2,477 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,408 software developers and data experts.

String Initialized to odd characters

I am creating a global string variable in the beginning of my code. I
am setting the string to an empty value. I am running the component
in debug mode and when I step through the component, the string is
initialized to odd characters and I cannot change the value.

The following is the code I have to create the variable:

private string strDirectory="";

When I step through the code the string has the following value:

strDirectory "酌ힸ³" string

When executing the following code, the value of the string does not
change:

strDirectory = fileinfo.DirectoryName;

Thanks in advance for any help.
Nov 15 '05 #1
2 1346
Elizabeth Graham <el**************@thomson.net> wrote:
I am creating a global string variable in the beginning of my code. I
am setting the string to an empty value. I am running the component
in debug mode and when I step through the component, the string is
initialized to odd characters and I cannot change the value.

The following is the code I have to create the variable:

private string strDirectory="";

When I step through the code the string has the following value:

strDirectory "酌ힸ³" string

When executing the following code, the value of the string does not
change:

strDirectory = fileinfo.DirectoryName;


That sounds like your debugger is toasted. What happens if you write
the value to something else from within your code? Do you have a short
but complete example which demonstrates the problem when you're
debugging?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
100
Hi Elizabeth,
That is really strange.
Can you provide some code how you create that variable. What do you mean by
global variable?
C# doesn't support global variable declaration.

B\rgds
100

"Elizabeth Graham" <el**************@thomson.net> wrote in message
news:77**************************@posting.google.c om...
I am creating a global string variable in the beginning of my code. I
am setting the string to an empty value. I am running the component
in debug mode and when I step through the component, the string is
initialized to odd characters and I cannot change the value.

The following is the code I have to create the variable:

private string strDirectory="";

When I step through the code the string has the following value:

strDirectory "酌ힸ³" string

When executing the following code, the value of the string does not
change:

strDirectory = fileinfo.DirectoryName;

Thanks in advance for any help.

Nov 15 '05 #3

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

Similar topics

8
by: Jason Heyes | last post by:
If s is a std::string, does &s refer to the contiguous block of characters representing s?
6
by: puzzlecracker | last post by:
Why would this work? - and it does! any thoughts? #include<stdio.h> void init(char **str){ *str="Awesome"; } main(){
3
by: happy | last post by:
How will I read a string using scanf in that function : to the write what scanedf will be written using fprintf customer_input(cust) /*---------------------*/ struct customer_record *cust; {...
28
by: rajendra.stalekar | last post by:
Hi Folks!!! I have a string let's say "hi" and got to reverse it using just a single variable for swapping, how do I do it? Regards, Rajendra S.
9
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a...
14
by: gustavo | last post by:
I was looking at the Sendmail's source code, and i've got confused about this kind of initialization: ------------------------ struct prival PrivacyValues = { { "public", PRIV_PUBLIC }, {...
9
by: somenath | last post by:
Hi All, I was going through one piece of code which is written by an experience programmer and it is working fine. But I think the use of "strstr" is not proper because it may show undefined...
2
by: nagesh0280 | last post by:
Hi experts, I'm from a Verilog HDL background and trying to learn C. There are a lot of similarities between Verilog and C but the concept of char arrays and strings has me confused. I'd...
14
by: rtillmore | last post by:
Hello, I did a quick google search and nothing that was returned is quite what I am looking for. I have a 200 character hexadecimal string that I need to convert into a 100 character string. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.