Does any body know the function that changes the color of the command prompt. I know there is one but i dont remember it and i am not finding i ton google.
Does any body know the function that changes the color of the command prompt. I know there is one but i dont remember it and i am not finding i ton google.
It depends on the OS. There are no such functions in standard C.
Assuming your shell supports them, ANSI escape code - Wikipedia, the free encyclopedia
Quzah.
Hope is the first step on the road to disappointment.
Here's an examples of using ANSI with bash
The last one sets the color back to whiteCode:#bash prompt RED="\[\033[1;31m\]" GREEN="\[\033[0;32m\]" ORANGE="\[\033[0;33m\]" BLUE="\[\033[0;34m\]" MAUVE="\[\033[1;35m\]" CYAN="\[\033[1;36m\]" GRAY="\[\033[0;37m\]" hmm="\[\033[0;30m\]" hmm2="\[\033[0;40m\]" WHITE="\[\033[00m\]" PS1="$MAUVE[$RED\u$CYAN\w$MAUVE] $WHITE" export PS1
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge