Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 863711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:21:29+00:00 2026-05-15T09:21:29+00:00

Somebody write this function void strToUpper(char *p) { while (*p) { *p = TOUPPER(*p);

  • 0

Somebody write this function

void strToUpper(char *p) {
  while (*p) {
    *p = TOUPPER(*p);
    *p++;                //<-- Line to pay attention
  }
}

I asked, why do you put the * before p++?

answer: because “It’s the same”, I corrected the code and then stay angry for a while, because both really work the same…

void strToUpper(char *p) {
  while (*p) {
    *p = TOUPPER(*p);
    p++;                //<-- Line to pay attention
  }
}

So I would like to share this with stackoverflow, example:

char s[6]=”hello”;

What would it do?

*++ptr;

This will evaluate the ++ pre-increment(over the pointer) and then the dereference operator *, so it will let a char value ‘e’ (second letter of “hello”) (that is not used in this case and could generate a warning on compilation) and the pointer will be pointing from the ‘e’ (position 1)

What would it do?

*ptr++;

This is a little weird because it will evaluate the dereference operator * first, so it will let a char value ‘h’ (that is neither used in this case), and then the ++ post-increment(to the pointer), so (again) the pointer will be pointing from the ‘e’ (position 1)

What would it do?

ptr++;

Finally it won’t have a Lvalue of char, but it won’t generate any warning if isn’t used, and the pointer will be pointing from the ‘e’ (position 1) too.

These three forms does the same from the pointer address point of view..

IMHO That’s the worst thing of some computer languages (almost everyone)..

“There is a poor Hamming distance between any code and any bug”

We have no redundancy when programming, if you take a Law book, and write random chars within, It will be readable, but if you type random when programming, you get a bug, 100% accuracy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:21:29+00:00Added an answer on May 15, 2026 at 9:21 am

    ++ has precedence over *. But I agree, it’s unclear when you mix both in the same statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 532k
  • Answers 532k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Have you tried a model with just the tables and/or… May 17, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer Turns out the answer is to update the iOS SDK… May 17, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer This is your code actually <div class="div1"> <div class="div2"> <div… May 17, 2026 at 12:10 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Please, may somebody explain me, what can raise an exception in this code? function
First of all I did not write this code. I found it on somebody
My professor defined this in the .h file void list_map(INTLIST* list, void (*f)(void *));
I've got: error a1 was not declared in this scope Can somebody please explain
In Javascript, I have this function to display the current date on our page
Hello can somebody write or point to a good symfony plugin installation tutorial. Here
can somebody help me to write a sql select to perform a task. So
I am new to linux, while compiling with dynamic library I am getting the
I need a function which takes an arbitrary number of arguments (All of the
int main() { int i=3; (++i)++; printf(%d,i); } This programs works with g++ compiler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.