22
Dec
Print In Reverse-Order
Related Blog Items
- Printing linked List in Reverse without Reversing The List Actually
- Questions asked in various job interviews (in Programming)
- Reverse Words in a String (In-Place)
- Calling conventions on the x86 platform
- Program that prints itself
This is only for printing, we are not storing the reversed output anywhere and another shortcoming is that it will cause SEGFAULT for a huge length string.
Recursive main() calling!! For beginners it will be a great to surprise to call main() function within main() it, but wait, Isn?t main() also a function?
/* reverse.c */#include
int main(){
char ch;
if ( (ch=getchar()) != ?n? ) {
main();
printf("%c",ch);
}
}
Is it necessary to have a main() function for success full compilation (there is no function main() written anywhere in any of our translation unit)
No, We can write a variable named main, and that is enough for the compilation phase to succeed.
/* withoutmain.c */int main;/* EOF */
[tags]Printing in reverse order,reverse order printing program,program that prints in reverse order][/tags]
Popularity: 10%
You need to log on to convert this article into PDF
Related Blog Items - Printing linked List in Reverse without Reversing The List Actually
- Questions asked in various job interviews (in Programming)
- Reverse Words in a String (In-Place)
- Calling conventions on the x86 platform
- Program that prints itself
Related Blog Items
- Printing linked List in Reverse without Reversing The List Actually
- Questions asked in various job interviews (in Programming)
- Reverse Words in a String (In-Place)
- Calling conventions on the x86 platform
- Program that prints itself
No Comments
No comments yet.