answersLogoWhite

0

What characters do you want to count? As I am not a mind-reader, I can only give you an example which might give you an idea.

size_t count_specified_char_occurances (const char *s, int c)

{

const char *p= s-1;

size_t count= 0;

while (*++p) if (*p==(char)c) ++count;

return count;

}

int main (void)

{

printf ("P in APPLE: %d\n", (int)count_specified_char_occurances ("APPLE", 'P');

return 0;

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is decleration part in C programming?

pointers.


What are the pointers in computer programming using c?

addresses


What is the difference between c plus plus and java programming?

Java doesn't have pointers. C++ has pointers.


What is the need to use pointers in C programming?

find the address


What are pointers in c programming language?

Pointers are variables that hold the address to a memory location. It makes copying/assignment very efficient, since it eliminates the need for copying entire memory blocks...only the address is copied. This is useful for example for function arguments.


What is a pointer in programming?

pointers are the variable which stores the address of another variable.


Can you explain the difference between pointers and variables in programming languages?

In programming languages, variables are used to store data values, while pointers are variables that store memory addresses of other variables. Variables directly hold data, while pointers hold the location of where data is stored in memory.


Do other programming languages implement pointers?

All programming languages implement pointers, but not all languages allow low-level access to memory through a raw pointer. Java, for instance, uses resource handles and smart pointers rather than raw pointers, however the actual allocation of memory is handled by the Java virtual machine (JVM) so there is no need for low-level raw pointers.


What are pointers in c-programming?

i don't realy have any idea about this but i think its the need of postures


What is virtual function table?

A virtual function table is a table of pointers to functions.


How do you explain what near far and huge pointers are to a beginner?

If you're a beginner you don't need to worry about near and far pointers. They are a concept that have been obsoleted on most PCs. If you are programming for an embedded device, read the datasheet. It will explain it in terms of the device you are programming for.


What is scanF function?

scanf() is an input function which reads input from the standard input devices such as keyboard. Syntax: scanf("Control Character",address_list); where control character is a sequence of one or more character such as %d,%f,%lf,%lld. Address list specifies the variables, pointers etc. e.g. scanf("%d",&num);