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

  • Home
  • SEARCH
  • 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 8682733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:51:15+00:00 2026-06-12T21:51:15+00:00

I read String* in C++ code and got confused, is there any necessarity to

  • 0

I read String* in C++ code and got confused, is there any necessarity to use String* ? Can I use char* instead?
E.g. StreamReader has ReadLine() function, why not require user arrange a char array first and the function justs stores the string in it, returns a char* pointer and everything works just fine.

  • 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-06-12T21:51:16+00:00Added an answer on June 12, 2026 at 9:51 pm

    Notice that char* is a pointer to single string or multiple characters (array of chars), while string* is a pointer to a single or mulitple (array) of string objects. However, C# doesn’t support pointers to managed types (such as string)

    Examples:

        unsafe void f()
        {
            char ch = '3';
            char* cPtr = &ch;
            *cPtr = '4'; // ch == '4'
            fixed (char* ccPtr = new char[30])
            {
                *(ccPtr + 15) = '4'; // arr[15] == '4'
            }
            string* ptr; // error: cannot declare a pointer to managed type
            fixed (char* pptr = new string(new char[] { 'a', 'b', 'c' }))
            {
                pptr[2] = 'd';
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can read XLS file with this code : string path =@c:\r\1.xlsx; OleDbConnection MyConnection
I have read string ńîôč˙ from file by using code page windows-1251, instead of
I'm using this code: public static MjpegInputStream read(String url) { HttpResponse res; DefaultHttpClient httpclient
I'm using this code to read the connection string from my app.config file but
I read about String Resources and I understood that you simply use the getString(...)
I've got this code that uses an fstream to read and write to a
I got a question... I got code like this, and I want to read
The following line of code is supposed to read a string, an int and
I've read the several discussions about storing code snippets but I did't find the
I read a bean code under spring-app.xml <bean id=mySessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean> <property name=dataSource ref=myDataSource />

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.