Logo Questions Linux Laravel Mysql Ubuntu Git Menu

naming pointers as 'pointerToXYZ' [closed]

When I'm using pointers in my code, I don't always remember whether I'm dealing with pointers or the objects they point to. So, I want to call my pointers 'pointerToXYZ'. Do any of the official style guides (Links to official style guides) describe pointer naming conventions?

UPDATE: Ok, I've made this a more concrete question; hopefully it can get reopened. If the answer is a simple "no" then I'll take it.

like image 950
tir38 Avatar asked Mar 24 '23 04:03


1 Answers

As for: "this is silly" it's pretty much upto you. In teams (/projects) there will likely be naming conventions which everyone agrees to. If you find this format a good naming convention for your own code then there's nobody stopping you.

Naming conventions for pointers that are commonly used aren't to common I think. One that I do see most often (as in consistent) is:

int *somenamePtr;
like image 71
Floris Velleman Avatar answered Apr 06 '23 06:04

Floris Velleman