Hermann
yep
Vedant
Hy
Nice dp bro...
Droningbro
I add c++ extension in vs code and downloaded mingw but c++ output is not coming in vs code
Droningbro
Can someone send the video or guide book of how to get output of c/c++ in vs code
Jollybox.h
b
Evil grin
Anyone familiar with named pipes
Anonymous
wow, I can't believe i can have gcc make etc. run on my Android phone !
라이트
Is exe file possible to delete self?
라이트
Where is professional chat room?
Pavel
Ah
Pavel
I misread your question
라이트
this you mean?
Thank you for your kind reply, after run, can exe be deleted itself?
Vlad
Is exe file possible to delete self?
Could have tried that already
라이트
I tested delete file after execute.
라이트
But I'd like to know, it can be deleted itself?
라이트
What is the best way to read unicode text line by line from file with WinAPI?
Pavel
Is exe file possible to delete self?
In windows exe can't delete itself while running because of the way how windows optimizes unloading some pages to the swap. But you can schedule deletion after you close your app, using some ways
z
But I'd like to know, it can be deleted itself?
Unfortunately, on Windows you can't delete file that is being opened. On Linux you can.
z
The approach maybe: Drop a shell script with sleep before the program exit.
z
Something like: system("nohup sh -c \"sleep 10; rm my_file.exe\" &");
라이트
Hmm... as I said, I've already tested delete exe file while running.
라이트
For more, I want to delete itself, not by another process.
라이트
Are you really professionals folks?
Hadaward 'Solly'
Pavel already answered it, altho no sources provided
라이트
A little disappointed...
Pavel
Pavel already answered it, altho no sources provided
It is googlable, and I'm lazy, but https://stackoverflow.com/questions/1606140/how-can-a-program-delete-its-own-executable
Hadaward 'Solly'
Hadaward 'Solly'
it's just for the formality
라이트
The Answers are not be checked.
Anonymous
Nice dp bro...
Thanks man
Kanni
Hello guys
Kanni
please how do I use "sort" on a vector
Kanni
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> using namespace std; int main() { vector<double> temps; for (double temp; cin >> temp; ) temps.push_back(temp); //compute the mean double sum = 0; for (int x: temps) sum += x; cout << "Average temperature: " << sum / temps.size() << "\n"; //compute the mean sort(temps); cout << "median temperature: " << temps[temps.size() / 2] << "\n"; return 0; }
Kanni
error: Severity Code Description Project File Line Suppression State Error (active) E0304 no instance of overloaded function "sort" matches the argument list Warning C4244 'initializing': conversion from 'double' to 'int', possible loss of data Error C2672 'sort': no matching overloaded function found Error C2780 'void std::sort(const _RanIt,const _RanIt)': expects 2 arguments - 1 provided Error C2780 'void std::sort(const _RanIt,const _RanIt,_Pr)': expects 3 arguments - 1 provided
Vlad
bruh
Henry
hi please my computer wont use the function i put into a header file(not standard) with visual studio
Kanni
std::sort(vec.begin(), vec.end());
Thanks man. It works now!!
Santhu
Can any one write the program for area of atriangle when three sides are given
Anonymous
Can any one write the program for area of atriangle when three sides are given
#include<iostream> #include<cmath> using namespace std; int main() { float a,b,c,s,Area; cout<<"Enter three sides of triangle : "; cin>>a>>b>>c; s=(a+b+c)/2; Area=sqrt(s*(s-a)*(s-b)*(s-c)); cout<<"Area of triangle is : "<<Area; return 0; }
Vlad
In c language
Replace cout and cin with printf and scanf and you're good to go
Santhu
Ok
Y
Any c++ linux dev here who knows much about qt?? I need help desperately to build one repository via qtmake
Pavel
The "Answer"s are not be checked.
I guess the author wanted a solution that does not exist
Ausir
Hi guys a quick question: Is alarm() blocking?
Anonymous
There is only one alarm active at a time, turned off by alarm(0);. Page 30-32 of PDF is about alarm: https://www.cs.princeton.edu/courses/archive/fall14/cos217/lectures/24_Signals.pdf
Xudoyberdi
https://pastebin.com/85MbWjH0
Xudoyberdi
Can't sort this in descending order.
Anonymous
Hello, off topic here, but is out a subclass of the System class in java?
Anonymous
Hello, off topic here, but is out a subclass of the System class in java?
1. @en_it_chats 2. Learn to use Google and official docs
Anonymous
Anonymous
At least the question answered without having to read a full document
Anonymous
Heyy guys, can anyone help me with my simple C exam tomorrow?
Anonymous
Xudoyberdi
It seems to work...
I needed letters in a descending order.
Xudoyberdi
I needed letters in a descending order.
https://pastebin.com/g8tujkd7
Jasur Fozilov 🐳
https://pastebin.com/g8tujkd7
if(letters[j]>letters[j+1]) This is where sorting in descending order if you reverse the> sign
Xudoyberdi
https://pastebin.com/g8tujkd7
Professor said I just reversely printed the values. I think I should have changed the condition.
Xudoyberdi
OMG! Is that the advanced version of bubble sorting?
Xudoyberdi
Thanks a lot.👍👍
Xudoyberdi
Hmm.
Anonymous
for(int i = 1; i < len-j; i++) That should be better. FIXED!
Xudoyberdi
Nice.
Abe
int f(int a, int b) { if(a <=2) return b; return f(a - 2, b) + f(a - 1, b); } input f(7, 5) can someone help me what's the answer?
Talula
By the way answer would be 35
Abe
Write the program and check...
done, but always error idk why
Abe
my teacher said the answer is 30 or 40 or 65
Talula
my teacher said the answer is 30 or 40 or 65
No it's not console.log(f(5,7)); function f(a, b) { if(a <=2) return b; return f(a - 2, b) + f(a - 1, b); } Tazzu@Tanaz-MacBook-Pro Server % node test.js 35
Anonymous
Not qsort, std::sort