The screen clean very fast cant see it move...
how can make it looks btr?

int i,j,k,a;
	char logo[9][59];
					
	for(a=0;a<59;a++)
	{	logo[0][a]=262;
		logo[8][a]=262;}
	for(a=0;a<59;a++)
	{	logo[1][a]=' ';
		logo[7][a]=' ';}
	strcpy(logo[2]," @@@@@   @   @@@@   @@@@      @@@@  @@@@ @@@@@ @@@@@ @   @ ");
	strcpy(logo[3],"   @    @ @  @   @ @         @     @     @     @     @@  @ ");
	strcpy(logo[4],"   @   @   @ @@@@  @          @@@  @     @@@@  @@@@  @ @ @ ");
	strcpy(logo[5],"   @   @@@@@ @   @ @             @ @     @     @     @  @@ ");
	strcpy(logo[6],"   @   @   @ @   @  @@@@     @@@@   @@@@ @@@@@ @@@@@ @   @ ");

	for(i=0;i<60;i++)//loop for move
	{	system("cls");
		for(k=0;k<9;k++)//loop for print whole logo
		{	for(j=0;j<67-i;j++)//loop for space
				cprintf(" ");
			cprintf("%c",262);
			for(j=0;j<i;j++)
				cprintf("%c",logo[k][j]);
			cprintf("%c\n",262);}}

Dani AI

Generated

posted code that clears the whole console each frame and prints the logo very fast; suggested pausing the loop. For a cleaner, more visible movement use two changes: (1) add a short, portable sleep between frames with the C++11 API and (2) avoid clearing the entire screen each time — move the cursor or print only updated lines. Clearing with system("cls") is slow and causes flicker; ANSI cursor movement or writing directly to the console buffer is much smoother.

Example pattern (portable delay + in-place redraw):

#include <iostream>
#include <vector>
#include <string>
#include <chrono>
#include <thread>

std::vector<std::string> logo = { "line1", "line2", "line3" }; // fill with actual lines

for (int pos = 0; pos < 60; ++pos) {
    std::string frame;
    for (const auto &line : logo)
        frame += std::string(pos, ' ') + line + '\n';
    std::cout << frame << std::flush;
    std::this_thread::sleep_for(std::chrono::milliseconds(80)); // visible but smooth
    std::cout << "\x1b[H"; // move cursor to home for the next frame
}

For the second question (getting input from a function into main) return a value or write into an output parameter. Examples:

int readInt() {
    int v = 0;
    std::cin >> v;
    return v;
}

void readIntRef(int &out) {
    std::cin >> out;
}

Notes and pitfalls: prefer std::string/std::vector<std::string> over manual char[][] to avoid out-of-bounds indexing; avoid magic numeric character codes (e.g., 262) and use literal chars or Unicode-aware handling; ANSI escapes may need enabling on older Windows consoles — otherwise use Win32 console APIs (SetConsoleCursorPosition / WriteConsoleOutput) for the smoothest, flicker-free animation.

Recommended Answers

All 4 Replies

2nd QUESTION

i call a function n read data , then how to get the input from that function to main function???

Don't kill me, but wouldn't you be able to slow down the process using like:
Sleep(a);

where "a" is the number of miliseconds to sleep, the function is declared in; "<windows.h>"

And about your second question, then how about using a return?

thanks a lot!!!
i kno can use return...
but jz i 4get how to coding =P
can give me a example???
thank you thank you!!!

thanks a lot!!!
i kno can use return...
but jz i 4get how to coding =P
can give me a example???
thank you thank you!!!

About the sleep, simply add the "Sleep(100);" just inside your loop?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.