Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 843595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:09:13+00:00 2026-05-15T06:09:13+00:00

I put C++ because I’m just starting in C# and I’m not sure if

  • 0

I put C++ because I’m just starting in C# and I’m not sure if there’s a difference.

if you declare an array

char arr[10] 

and fill in values for arr[0] through arr[8], what value will be put in arr[9]?

a space ‘ ‘? An endline ‘\n’? ‘\0’? Or is it nothing at all?

I’m asking this because I’ve always used tactics like this

char word[20];
for(count = 0 ; count < 20 ; count++)
{
  cout << word[count];
}

to print the entire contents of an array, and I was wondering if I could simplify it
(e.g., if the last entry was ‘\0’) by using something like this

char word[20];
while(word[count] != '\0')
{
  cout << word[count];
}

that way, I wouldn’t have to remember how many pieces of data were entered into an array if all the spaces weren’t filled up.

If you know an even faster way, let me know. I tend to make a bunch of mistakes on arrays.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:09:14+00:00Added an answer on May 15, 2026 at 6:09 am

    The C# syntax for constructing a character array is:

    char[] arr = new char[10];
    

    All values in the array will be initialized to '\0'.

    Perhaps a List<char> would be better for your situation where you don’t know how many characters you need. Another option to consider is a StringBuilder. Or use a string if you don’t need mutability.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a animation (an array of images) that I put in viewDidLoad because
Someone knows how to put an icon in a eVB 3 application, because i
i had a problem on confusing how to put ontouch inside my coding because
I wanna know where is the best place to put the ini_set() functions, because
I understand that Struts2 Action classes are thread-safe, because the actions are put in
I'm using maven to build the project and compile failed because I put class
I put volatile because it's only vaguely so. I have a class which has
I'm sorry that I put this question because I think that is simple but
I have this table with some styled tds (I put screenshot because the content
Put them all in one separate folder structure or along with classes which implements

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.