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 3437972
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:07:50+00:00 2026-05-18T08:07:50+00:00

I like reinventing the wheel for learning purposes, so I’m working on a container

  • 0

I like “reinventing the wheel” for learning purposes, so I’m working on a container class for strings. Will using the NULL character as an array terminator (i.e., the last value in the array will be NULL) cause interference with the null-terminated strings?

I think it would only be an issue if an empty string is added, but I might be missing something.

EDIT: This is in C++.

  • 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-18T08:07:51+00:00Added an answer on May 18, 2026 at 8:07 am

    "" is the empty string in C and C++, not NULL. Note that "" has exactly one element (instead of zero), meaning it is equivalent to {'\0'} as an array of char.

    char const *notastring = NULL;
    char const *emptystring = "";
    
    emptystring[0] == '\0';  // true
    notastring[0] == '\0';   // crashes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To avoid reinventing the wheel, I am generating a form using CakePHP's form helper,
I keep feeling like I'm reinventing the wheel, so I thought I'd ask the
When programming in CDC I'm always reinventing the wheel, re-implementing stuff like Arrays.toString(Object[]) .
I'd like to 'shear' a numpy array. I'm not sure I'm using the term
I feel like I am always reinventing the wheel for each application when it
Like many programmers, I'm prone to periodic fits of inspiration wherein I will suddenly
like in java I have: Class.getSuperClass().getDeclaredFields() how I can know and set private field
I have a class with operator() like this: struct S { int operator()(int a,
In the spirit of not reinventing the wheel, can anyone point me to free
Without reinventing the wheel, what I can use to manage user sessions in a

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.