Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What does '\r' and '\b' mean? Please explain with example.

Answers were Sorted based on User's Feedback



What does '\r' and '\b' mean? Please explain with example. ..

Answer / ankita

\r is known as carriage return
e.g printf("ABC\rDE");
ABC.
then becoz of \r cursor comes back to the 1st char i.e here
A after that DE is there then finally it print
DEC with cursor on C.
\b is known as back literal
e.g. printf("ABC\bDE");
then ABC then finally ABDE will get printed.

Is This Answer Correct ?    63 Yes 27 No

What does '\r' and '\b' mean? Please explain with example. ..

Answer / brite

Even you are wrong Siva.
printf("ABC\rDE") will print DEC not DE.

Is This Answer Correct ?    32 Yes 16 No

What does '\r' and '\b' mean? Please explain with example. ..

Answer / siva

above two answers are wrong.
i tested the following is the correct answer


\r is known as carriage return
e.g printf("ABC\rDE");
DE will get printed.
\b is known as back literal
e.g. printf("ABC\bDE");
ABDE will get printed.

Is This Answer Correct ?    31 Yes 21 No

What does '\r' and '\b' mean? Please explain with example. ..

Answer / subh

Depends on terminal configuration

http://stackoverflow.com/questions/17236242/usage-of-b-and-r-in-c

Is This Answer Correct ?    1 Yes 2 No

What does '\r' and '\b' mean? Please explain with example. ..

Answer / mahboob ur rahman

System.out.print("mahboob\rkhan");
output:
mahboob
it will just priint mahboob

Is This Answer Correct ?    1 Yes 13 No

What does '\r' and '\b' mean? Please explain with example. ..

Answer / yogita

\r is used for carriage return and \b is used for computer
baep

Is This Answer Correct ?    18 Yes 32 No

What does '\r' and '\b' mean? Please explain with example. ..

Answer / v

printf("ABC\bDE");


It prints only "DE", because the printed ABC will be removed
by '\b'

Is This Answer Correct ?    11 Yes 28 No

Post New Answer

More C++ General Interview Questions

Is c++ still in demand?

0 Answers  


Is map thread safe c++?

0 Answers  


What is a virtual destructor? Explain the use of it?

0 Answers  


How do you define a class in c++?

0 Answers  


Find out the bug in this code,because of that this code will not compile....... #include <iostream> #include <new> #include <cstring> using namespace std; class balance { double cur_bal; char name[80]; public: balance(double n, char *s) { cur_bal = n; strcpy(name, s); } ~balance() { cout << "Destructing "; cout << name << "\n"; } void set(double n, char *s) { cur_bal = n; strcpy(name, s); } void get_bal(double &n, char *s) { n = cur_bal; strcpy(s, name); } }; int main() { balance *p; char s[80]; double n; int i; try { p = new balance [3]; // allocate entire array } catch (bad_alloc xa) { cout << "Allocation Failure\n"; return 1; }

2 Answers   Impetus,


What is #include sstream?

0 Answers  


Which should be more useful: the protected and public virtuals?

0 Answers  


How the keyword struct is different from the keyword class in c++?

0 Answers  


What are multiple inheritances (virtual inheritance)?

0 Answers  


Can non graphic characters be used and processed in C++?

0 Answers   HCL,


What is the use of volatile keyword in c++? Give an example.

1 Answers  


what is smart pointer & use of the smart pointer ???

2 Answers  


Categories