in Technology by
How is Pointer Arithmetic work on Character Pointer?

1 Answer

0 votes
by

If we increment the character pointer by 1 then it will point to the address which will be just 1 byte more to the current pointing address.  Let us see an example where pcData is a character pointer and we performing an arithmetic operation on it.

char *pcData =NULL;

 

When we increment the pcData then it points to the next character location without impacting the stored data. The size of the character is 1 byte that’s why pointer moves only 1 byte of memory. .

pcData++;

 

Related questions

0 votes
    How does pointer arithmetic work?...
asked Jan 24, 2021 in Technology by JackTerrance
0 votes
    How is Pointer Arithmetic works on Float Pointer?...
asked Jan 24, 2021 in Technology by JackTerrance
0 votes
    Which of these stream contains the classes which can work on character stream? (a) InputStream (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Can we perform arithmetic operation on pointers?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    1.In a CPU. does the complex arithmetic and logical calculations on data. 2. The disk drive is a collection of ... of the digital dama Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    B. Fill in the blanks. 1. In a CPU, does the complex arithmetic and logical calculations on data. 2. ... thin circular discs called Select the correct answer from above options...
asked Dec 20, 2021 in Education by JackTerrance
0 votes
    Hi, I am a relatively new programmer and my teacher gave us this problem to fix. Thing is, I have no idea ... wrong with this problem? Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    Can math operations be performed on a void pointer?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    What is a pointer on pointer?...
asked Jan 17, 2021 in Technology by JackTerrance
0 votes
    What happens when we invoke a method on a nil pointer?...
asked Nov 10, 2020 in Technology by JackTerrance
+1 vote
0 votes
    What is a pointer on a pointer in C programming language?...
asked Nov 8, 2020 in Technology by JackTerrance
0 votes
    What arithmetic operators cannot be used with strings in Python? a) * b) – c) + d) All of the mentioned...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    What arithmetic operators cannot be used with strings in Python? a) * b) – c) + d) All of the mentioned...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    The current copy of the database is identified by a pointer, called ____________ which is stored on disk. ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
...