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
  • 2
    Your error is actually because you need to assign the pointer to the address of a variable: const int *p = &x; And of course you cannot assign *p, because the resulting int is const! (Not to mention that you're attempting to assign an const int to a const int*) Commented Apr 28, 2016 at 12:03
  • Ok I just got that, and tried it quickly on my IDE. But same problem in my IDE. And im using codeblocks, so it tells me exactly where the error was. And ofcourse the error is pointing at where i declare *p = &x @AndyG Commented Apr 28, 2016 at 12:04
  • Read the edits to my comment. I address the other issues. Commented Apr 28, 2016 at 12:05
  • Ok Thanks a lot @AndyG ! I just messud up, when i tried to assign the pointer. Turns out i dont need the astrix.... -.- Commented Apr 28, 2016 at 12:06