Enums are group of symbolic constant each having some integer value.
enum(PASS_MARK=60,MERIT_MARK=70)
defines two symbolic constant PASS_MARK and MERIT_MARK as 60 and 70,- it could be done with #define as well.
However without specific values ,- the values are assigned automatically ,- starting with 0 for the first element and 1 for the second, 3 for the second etc.
In case if we state a number for the first element then it will increment the value of each consecutive elemts with '1'.
enumerations can be used in place of a macros for example let us consider an example where a function is failing for many reasons like array out of bounds, divide by zero ,and memory allocation failure when you call such a function and if something goes wrong you may not know for what reason exactly in that case you can make an enum like enum error { ARRAY_OUT =0, MEMORY_FAIL, DIVIDE_ZERO } and so on instead of defining each one by macro Then based on return value it would be easy to locate eror . And ofcourse it is a user defined type.The values assigned will be from 0 to the number of elements present . you can also assign different values in between like enum week { sunday, monday, tuesday=4,wednesday,thursaday} then wednesday and thursday would have a value of 5 and 6
Enums are group of symbolic constant each having some integer value.
enum(PASS_MARK=60,MERIT_MARK=70)
defines two symbolic constant PASS_MARK and MERIT_MARK as 60 and 70,- it could be done with #define as well.
However without specific values ,- the values are assigned automatically ,- starting with 0 for the first element and 1 for the second, 3 for the second etc.
In case if we state a number for the first element then it will increment the value of each consecutive elemts with '1'.
How can we get direct printout of a c file without giving print command from bin or tc?eg i want to get the printout of a program directly after execution from the c window itself.
using c-strings write a program that will analyse the text"1.1my brother is taller than me.1.2 I am a boy of sixteen years old". The program should remove multiple spaces betweem words,find the longest word in the text,search and identify the number of letters"e", extact the number of integers , extract the number of doubles, extract the number of words in each sentence and identify the number of sentences in the text.