Category : ansi

all, I am an absoluty newbie of c/c++. When I compile my main.cpp in ubuntu command line: g++ main.cpp, coming with following error: main.cpp:(.text+0xa8):for‘mesh(std::__cxx11::basic_string<char, std::char_traits, std::allocator >)’undefined reference collect2: error: ld returned 1 exit status All my codes are: main.cpp #include <iostream> #include <sstream> #include <vector> #include "mesh.h" #include <string> using namespace std; int main(int ..

Read more

I’m using Git Bash on Windows 10 with Windows Terminal and for this Python project, the ANSI escape sequence are not working. from colorama import init, Fore from sys import stdout init(convert=True) # code … I tried to print a test text # The code above stdout.write(‘{GREEN}Test{RESET}’.format(GREEN=Fore.GREEN, RESET=Fore.RESET) Here’s the output: ←[32mTest←[0m I’m sure that ..

Read more

I was working on a function which looks like so: inline std::ostream& mvUp(int n,std::ostream& ss){ char u[8]; sprintf(u,"3[%dA",n); ss<<u; return ss; } and using it like so: std::cout<<mvUp(1); however it shows error: std::cout<<mvUp(1); | ^_____too few args in function call ^_______________no operator "<<" match these operands I also tried: std::cout<<mvUp(1,std::cout); but still not working. std::cout<<mvUp(1); ..

Read more

While studying the ANSI control sequences I came across unclear behaviour. I tried to make "matrix" effect in terminal, which changes one random digit per loop iteration in a row of n 0/1 digits: #include <iostream> #include <chrono> #include <thread> const int n = 5; // row length const int pause = 50; // milliseconds ..

Read more