I take some issues with this question. I think it's framing things in a way that is misleading.
questions that are trivial such as "How to convert a C string to a QString or "What is the difference between . and ->" get a lot more views, answers and votes than real questions of the form "How do I frob this widget" that bother real professionals.
I don't see a significant fundamental difference between the forms of the examples you gave. And from the rest of what you say about fewer views and votes, it sounds like what you're really describing a difference about is (at least partially) usefulness.
I wouldn't call these questions "trivial". Something trivial for an expert can be deep to a beginner. In other words, "triviality" is hard to pin down to something that is the same for everyone. Instead, I'd just say it as how I see what it is that you've described: "relatively-common" questions.
Who says "real professionals" don't ask those relatively-common questions? By definition, a common question is one that many people will have at some point in their journey of learning.
And who says a "real professional" doesn't need reminding of the answers to common (and even simple or basic-appearing) questions? You probably know what I'm talking about- those questions where you find it hard to remember the answer because it's not very intuitive, and you keep having to ask the question and read the answer again.
What is a "real professional" anyway? I don't like this gatekeeping language. Are you saying some professionals are illegitimate? And upon what basis? Whether they at some point in their lives ask a common question? Even if people like that exist that have never asked a common question about their field in their life, I don't see how that is something particularly worthy of praise, and even if it were, why it should be something worthy of extra reward on this site, which was not built to make them happy, but to build a knowledge base for everyone.
And why do you think that whatever this "real professional" class is should be catered to more than the rest of the site's designated audience? A reminder that (at least at one point), Stack Overflow's welcome/front-page (or something along those lines) said something to the effect of it being a site for professional and enthusiast programmers. Even if it no longer says that, the idea it was getting at still holds true. When did we all become okay with this gatekeeping / classism? Or did nobody notice it hiding in the question?
Once you frame the difference as one of commonality of questions and widespread-ness of usefulness (I think it's quite logical to say that they correlate) then you'll see that this is not- as far as the system in its mechanics is concerned- an issue at all. Usefulness is one of the primary recommended qualifiers of usage of upvote and downvote buttons given in their tooltips. Usefulness is one of the primary goals of the knowledge base we're building.
Fewer views mean less possible votes for good answers and hence less incentive for people to answer.
Says who and for who? Not everyone who is here is playing a game to get magic internet points. Some people just like helping people using their expertise. Not that that necessarily leads to behaviours that are in the best interest of the site ecosystem, but the point stands.
Now, do I think it's a great thing that in some sense, unilaterally, answers to more common questions- regardless of the level of expertise required or demonstrated in or by the answer- get more votes (and therefore reward more reputation) compared to questions which get fewer views, votes, and therefore give fewer magic internet points to the answerer?
But I have come to see and understand the reputation system as one that is not a measure of expertise, but of usefulness of contributed content, and if you choose to understand it that way (because it seems that that is not what the Help Center or FAQs currently explain it as), then everything about how some people have more or less reputation falls into place for the most part (besides voting fraud and serial voting).
Would I like it that when I write an answer that I think used/demonstrated more of my expertise, it get rewarded relatively more? Of course! But the system has never chosen to do that, and I accept that reality. Anyway- how would you evaluate something like that objectively? Recall my previous point that triviality is not something that everyone evaluates equally.
How can Stack Exchange solve this problem?
Bounties. In that sense, it's already solved. See a really great answer that tackles an uncommon question that you encountered and gives it great depth and illuminates the answer in an understandable way? Set a bounty and pick the option that says "reward an existing answer".