We\'ve detected that you\'re using AdBlock Plus or some other adblocking software. Please be aware that this is only contributing to the demise of the site. We need money to operate the site, and almost all of that comes from our online advertising.

Linux tips and tricks for all users.

Very cool code that prints a tick sign in asterisks. This is awesome C++ code.

This code prints out a tick sign using asterisks. I tested this code on Fedora 19 and gcc 4.8 and it compiles without any problems.

#include <iostream>
#include <iomanip>

using std::cout;

int main() {

	cout<<std::setw(8)<<"*"<<"n";
	cout<<std::setw(7)<<"*"<<"n";
	cout<<std::setw(6)<<"*"<<"n";

	cout<<"*  *"<<"n"<<"* *"<<"n"<<"*";
	cout<< "n";

	return 0;
}

This is what you should get when you compile and run this code sample.

homer@neo $ ./loop 
       *
      *
     *
*  *
* *
*

Very cool indeed.

Post a Comment

Your email is kept private. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *