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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:21:10+00:00 2026-06-03T23:21:10+00:00

When I try to initialize a new char* array using fixed while being ilitialized

  • 0

When I try to initialize a new char* array using fixed while being ilitialized allong side other things, it does not work. The following code is an example of that

fixed (char* buffer = new char[25])
{
     //This works just fine
}; 

fixed (char* origionalPhrase = phrase, char* buffer = new char[25])
{
    //This does not
}

The syntax parser underlines the new char[25] as being “Cannot implicitly convert type ‘char[]’ to ‘char*'”. I need both those variables to be initialized as char* arrays. The first variable, origionalPhrase variable initializes just fine. The MSNDN documentation points out that:

fixed (byte* ps = srcarray, pd = dstarray) {...}

will work.

I used this MSDN article.

  • 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-03T23:21:12+00:00Added an answer on June 3, 2026 at 11:21 pm

    Well, the MSDN example has only one char * (or actually byte *). Remove the second one.

    fixed(char* origionalPhrase = phrase, buffer = new char[25])
    //                                   ^-- removed char*
    {
       // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When i try to initialize velocity engine using VelocityEngine engine = new VelocityEngine(); engine.init();
When I try to initialize the speech recognizer with the following code: SpeechRecognizer rec
Try to see which cast is faster (not necessary better): new c++ case or
I'm trying to initialize SecureString and I need Char* for that. I tried to
I try to execute following code using gcc test.c -o test.o -ldbi command. #include
I am trying to copy certain parts of a string into other, new strings,
I am getting the Following problem when i try to initialize the directx SlimDX.Direct3D9.Direct3D9NotFoundException
Hi I am new to java and I thought I'd try produce a game
In order to initialize my VouchersDGV Data Grid View I'm Using the following DGV.AllowUserToDeleteRows
Trying to create an array of structs (new to C), but I am getting

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.