Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • You probably meant new char[50] to allocate 50 characters. Commented Apr 18, 2020 at 5:33
  • 1
    If you can use std::string arg1{}; if not then char *arg1 = new char[50]; (don't forget, you are then responsible for calling delete[] arg1; when done with arg1) Commented Apr 18, 2020 at 5:36
  • So to be clear, new char[50] creates the space for 50 characters? That's how you would initialize a pointer variable and I could assign it an actual value somewhere else when needed? Commented Apr 18, 2020 at 5:38
  • Yes you are right I meant char[50] Commented Apr 18, 2020 at 5:39