char is a type and c is a name, to me, it always make more sense to put the name alone and have the type together, like "char* c", I can tell immediately that it is a pointer to a char, so its always goes like [type] [name]. But in contrast, most C/C++ code I found prefer the other way around, like "char *c". Is there any specific reasons why this is so?
jpg 0
Posts
-
Why does most C/C++ developer prefers char *c instead of char* c? -
If you have kids...you would notice that: - everything is touch screen and mouse is a history to them - Windows is hard for them to use - No need to type, just use google voice recognition to search for what they want - damaged TV - since they are so used to touch screen, and would just use the remote control to hit the TV screen when they found that it's not responsive to touch
-
A real solid and comprehensive library for C++?For the last ten years newcomers choose Java/C# over c++ is mainly because they both come with comprehensive libraries that can fulfill most of their requirements. In C++ we have std and boost, but in some point they are confusing and their functionalities are somehow overlapped, which introduced a much harder learning experience compared to other languages. The closest framework I know is Qt, but then Qt isn't open source.
-
Best way to store over 1TB of photos and videosI have a 3 years old daughter, and now a new born baby, from the past 3 years I have over 1 TB of photos and videos, from my experience hard disk will just fail with no reasons and signs, my usual way of storing those precious files is to use 2 USB hard disks, and keep them synchronized with MS SyncToy, and recently I added on more hard disk, so I am keep 3 copies of all those files. But now I am thinking that after all, all 3 drives are still located at home, I can only prevent bad sectors problem but not from accident like a fire break. I checked the price of those online storage, dropbox charge $579 per year for unlimited storage, and google drive charge $50 per month, if I am going to keep those growing size of photos and videos until they are 18 years old, that would be a lot of money. Anyone here having the same problem like mine? Having trouble on keeping large volume of files that you cannot afford to lose?
-
YouPreferSomethingLikeThis or you-prefer-something-like-this?Before I step into the world of linux, I always use camel case, but in the linux world, almost everything are separated by a dash Now I have to manage a cross platform project and is thinking about which naming convention to adopt
-
What can Windows 7 do but Windows XP can't???
-
Anyone actually like Linux more than Windows?I had been using Windows and Windows-only since Windows 3.0, until months ago I got myself a mac book pro, this is the first time I really get into the Linux world, but I hate it, however, this experience bring me to another level, Windows isn't the only thing out there, so I install Ubuntu on one of my system, Wow! I love it, as a Windows user, I found most thing hard to understand, the overall concept, the file system, everything, but after a couple weeks of trial and error, trying to undersand how permission works in the Linux world, how to execute a bin file, etc., at this point I feel a lot better with the Linux system. Up to this point I would say that I actually like Linux more than Windows, learning to 'not having permission' to do everything to your system at all time is actually a good thing.
-
How do you name your project?I am currently using some very boring yet descriptive names for my projects. Such as "IssueTracker" for issue tracker, "Forum" for forum, etc. Are there any cool ways to name your project?
-
What is going wrong with Nokia?It's market share in the cell phone market is dropping like hell in recent years! :omg: :omg: :omg:
-
As a desktop app developer, would you target Mac OS and Linux?Since most people use Windows
-
Any site like The Code Project but focus mainly on C++???
-
Just a thought: Is there a limit on url string?Wow! Thanks a lot!
-
Just a thought: Is there a limit on url string?If not, how to prevent someone from sending an URL with Gb size to a server?
-
What make facebook being so successful?There were tons of social sites before facebook, but why facebook can be so successful?
-
Really frustrated when moving from C# to C++Saying this makes you feel better?
-
Really frustrated when moving from C# to C++Mostly because of how pointers and references work, and also function definition seems very different. :((
-
Passing char* to a function and change the argument problemHow can I call 'ChangeString' from main and have the function change the passed char pointer to some other string value? Thanks in advance.
#include using namespace std;
void ChangeChar(char* value)
{
*value = 'b';
}void ChangeString(char* value[])
{
*value = "Changed!";
}int main()
{
char c = 'a';
cout << c << endl;
ChangeChar(&c); // OK!
cout << c << endl;char str\[\] = "Hello World"; cout << str << endl; // ChangeString(&str); << error! cout << str << endl; system("pause"); return 0;
}
-
The physical keyboard layout really affects the speed of input!I am so used to have the left-bottom-most key on the keyboard to be the "CTRL" key, on system such as MacBook which isn't the case, it really hurt!
-
Function pointer problem#include #include using namespace std; void Print(const string& value) { cout << value << endl; } void PrintBy (const string& value, void (*printer)(const string& value)) { printer(value); } class Printer { public: void Print(const string& value) { cout << value << endl; } }; int main() { string s = "hi"; Print(s); // why this work? PrintBy(s, &Print); // but this does not work!? Printer p; PrintBy(s, &p.Print); return 0; }
-
QT = C++ version of the .Net Framework in native code!have you even tried?