Pasolino 🛰
CLion, CodeBlocks, Visual Studio
I've tried CodeBlocks, but WindowsBGI won't open
Dima
Install Linux
Pasolino 🛰
Yes you can try visual Studio
What parts of it do I have to install?
Igor🇺🇦
What parts of it do I have to install?
C++part https://visualstudio.microsoft.com/vs/features/cplusplus/
Angelo
Can the problem be DEV-C++?
Ti dice che non hai il compilatore MinGW64
Joesph
Stupid Compiler https://redd.it/ex9t7t by @programmer_humor
Anonymous
Install Linux
Why in C++ when building a program becomes its size  15 MB Do you have an idea for this issue?
Anonymous
Depending on the Compiler you use
Anonymous
If you don't like the size, Use the upx to compress a program
Anonymous
In the coming years C++ will be more efficient
Anonymous
ajee
Getting older
Bhaskar
Bhaskar
I am unable to input the names of the car models
Bhaskar
the program just skips over the names
Javi
I am unable to input the names of the car models
Why do you use different ways to get the names and the years? Getline takes a pointer, not a variable. Also you are leaking memory by not deleting car_det
Anonymous
Any malayalis here
Anonymous
Oru tamilans
Anonymous
Plz dm me
András
Try to make another getline before reading car name
Bhaskar
and I forgot to use delete 😅
Bhaskar
Try to make another getline before reading car name
thanks, it helped. can you explain the problem?
Chernykh
thanks, it helped. can you explain the problem?
Andras, getline is a function just read the stream without waiting user input. If u have a question like "For what does this function exist?": There are many streams in C++, for example "ifstream" (input file streams), "stringstream" and so on, getline exists in general for it.
Chernykh
cin and cout are the implementation of iostream
Bhaskar
getline
Chernykh
Do u have an example?
Bhaskar
Bhaskar
line 19
András
thanks, it helped. can you explain the problem?
Getline read till /n. So it reads this /n from your previous input, that's why it didn't work as you wanted
Chernykh
Andras, r u sure? I'm not
András
Andras, r u sure? I'm not
Extracts characters from is and stores them into str until the delimitation character delim is found (or the newline character, '\n', for (2)).
András
http://www.cplusplus.com/reference/string/string/getline/
Chernykh
Yah, my mistake
Chernykh
I rarely use user input from console
Chernykh
@hellking_22, some advices for u: 1) Do not use new, it threatens memory leak 2) Read about shared_ptr if u wanna use prt. If it's unnecessary (not OOP things) use value allocation. 3) It's better to use std containers, not static array 4) "using namespace" better to use inside narrow scope, the more narrow the better practice
Chernykh
Additional for point 1: shared_ptr from point 2 also solves this problem
Vikky
https://soringalgo.blogspot.com/2019/12/sorting-part-1.html?m=1
Anonymous
hello
Anonymous
hello
Anonymous
Hello,I wanna show evry one min just one charater to output what's the problem ?
Anonymous
my code shows all char at the same time
Anonymous
sleep 60000
Anonymous
sleep use ms not min
klimi
oh its pointer and C
klimi
nvm
Anonymous
i wanna print my text like this
Anonymous
i'm new how can i do that
Serhii
i'm new how can i do that
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #ifdef _WIN32 #include <Windows.h> #define sleep_for Sleep #else #include <unistd.h> #define sleep_for sleep #endif void main() { char text[] = "This is printing...\n"; for (int i = 0; i < strlen(text); ++i) { printf("%c", *(text + i)); fflush(stdin); sleep_for(100); } }
Bhaskar
thats why I am using them
Chernykh
i am solving the exercise given in the book, and it said to use char array and new
It's ok man. I've just gave u advise, in future this one can improve ur code
Bhaskar
thanks,
Chernykh
For each new in this chat: Which book do u use and why does this books teach u write code in c style or ooold cpp
revenant
/Sieg hail. I'm novice to programming, so I'll mostly read your posts and maybe sometimes ask questions. I've read the rules.
revenant
/Sieg
Chernykh
didn't work
#include <iostream> #include <string> #include <thread> void printAsInSpyMovie(const std::string &ptintable) { using namespace std::chrono; using namespace std; for (const auto &let: ptintable) { this_thread::sleep_for(0.05s); cout << let; } } int main(int argc, char **argv) { if (argc < 2) { std::perror("Enter string u wanna print"); exit(0); } std::string printable; for (int i = 1; i < argc; ++i) { printable += i == argc - 1 ? std::string(argv[i]) : std::string(argv[i]) + " "; } printAsInSpyMovie(printable); return EXIT_SUCCESS; }
Chernykh
Marián
didn't work
done this few times because of cool way to create presentation for people, simply use std which can easily flush inline (ikr std::cout is trash, but its simple program so why not...) and then use chrono to sleep
Bayan
Bayan
Hello guys, I want create file in folder created , how to write that in c language?
Chernykh
reformat u code pls
Chernykh
fopen which u've use is a C function
Chernykh
Code in C should look same to u sent a guess
Chernykh
Whole this code is C code))
Pasolino 🛰
Hi guys, can anyone recommend me a library for graphics? As a compiler I use DEV-C ++
Igor🇺🇦
Hi guys, can anyone recommend me a library for graphics? As a compiler I use DEV-C ++
Dev c++ is not a compiler. It's an old IDE that use an old GCC compiler