Pretty crazy that we're closer to 2030, than we are 2005. Where did the time go!
0 Members and 1 Guest are viewing this topic.
Code: [Select]char* dest, src;This is legal code; it may conform to your coding convention, and it may even be what was intended, but when you’ve had enough experience writing C code, you’ll notice that this declares dest as a char pointer while declaring src as merely a char, and even if this might be what you wanted, it probably isn’t. That code smells a little bit dirty.
char* dest, src;
char *dest, src;
I have a programming folder, and I have nothing of value there
Our species really annoys me.
He says:QuoteCode: [Select]char* dest, src;This is legal code; it may conform to your coding convention, and it may even be what was intended, but when you’ve had enough experience writing C code, you’ll notice that this declares dest as a char pointer while declaring src as merely a char, and even if this might be what you wanted, it probably isn’t. That code smells a little bit dirty. I thought that this code would declare both dest and src as char*. What he meant was:Code: [Select]char *dest, src;which would declare dest as char* and src as char.
This is one of the reasons I like to stick my *'s with the variables! char *dest, src and char* dest, src are the same thing.
I'd personally do as Joe suggests
You might be right about that, Joe.
I'm with iago, I never declare more than one variable per line. It's just an awkward thing to do, imho.
private string m_first;private string m_last;private string m_suffix;private string m_adr1;private string m_adr2;private string m_city;private string m_state;private string m_zip;
private string m_first, m_last, m_suffix, m_adr1, m_adr2, m_city, m_state, m_zip;
So do your guys' classes that might have 10 member variables of which 8 are the same type have 10 lines?Code: [Select]private string m_first;private string m_last;private string m_suffix;private string m_adr1;private string m_adr2;private string m_city;private string m_state;private string m_zip;Or:Code: [Select]private string m_first, m_last, m_suffix, m_adr1, m_adr2, m_city, m_state, m_zip;I don't really see how the second is more awkard then the first.