Anonymous
And QTCreator creates so many issues wrt to your project layout. Anjuta is much better. But my vote would be for VS Code if you can't use CLion.
Anonymous
For python pycharm or terminal
Anonymous
Why?
much broader in scope. everything from web development to GUI apps to machine learning. you can pick a specialised language like C later if you want.
Anonymous
yes
Okk thanx man
Anonymous
And QTCreator creates so many issues wrt to your project layout. Anjuta is much better. But my vote would be for VS Code if you can't use CLion.
with Qt 6 they are deprecating qmake and completely switching to CMake, so that shouldn't be an issue
Anonymous
and even with Qt 5 CMake is just as viable
Anonymous
For python pycharm or terminal
For python, you have so many free IDEs. But this group is only for C/C++ discussion. So please stick to that.
Anonymous
we can't speak Italian here 😬
Prince Of Persia
how to set synonyms name for std::vector without using vector like typedef std::vector<type> MyType; I'm looking for something like typedef std::vector MyType; to use it like MyType<sometype> holder;
Anonymous
with Qt 6 they are deprecating qmake and completely switching to CMake, so that shouldn't be an issue
The problem is not with just the build tool. In QR Creator try creating a folder for your external dependencies (like Google test) and try reading it from CMake. You will have a torrid time. Usually for any projects that I work on, I prefer this layout Root CMakeLists.txt lib CMakeLists.txt src (For own libraries built here) app CMakeLists.txt src (For the executable) include (for installation) tests CMakeLists.txt src external (For external dependencies) packages .cmake files for packages
Prince Of Persia
Anonymous
gets error
ye sorry, forgot how to write that. editing in a moment
Prince Of Persia
Anonymous
i have used some external dependencies. but Arch's repositories have boost, fmt, gtest, range-v3, so never needed anything other than a find_package in the CMakeLists.
If you work on anything significant like Machine Learning projects in C++, you would have to get used to finding the right .cmake files which can be a pain to say the least. Hopefully b2 will address it. It is moving in the right direction so far. No matter what people say about CMake 3.8 +, I hate it
Sergeant Stedenko
much broader in scope. everything from web development to GUI apps to machine learning. you can pick a specialised language like C later if you want.
I learnt C and built commercial software with it 30+ years ago, but I have no experience or knowledge of python so I'm curious.
Anonymous
I learnt C and built commercial software with it 30+ years ago, but I have no experience or knowledge of python so I'm curious.
no i just think python is a better first language to learn today. if you have 30+ year experience in C, no reason to change.
Sergeant Stedenko
no i just think python is a better first language to learn today. if you have 30+ year experience in C, no reason to change.
Well C has it's strengths, like small keyword set etc and simplicity in learning, speed of execution etc, but no language is perfect. Its simplicity can also be seen as a weakness though, depends on what you're doing.
Anonymous
i iz switching to Haskell ;-;. i don't think they will use any other language in the whole curriculum.
It is good. But you will have to know Lambda Calculus. GHC is the best compiler I have seen. Can at times optimize code to be much faster than C even. But it has the advantage of knowing that pure functions are being used which C or C++ compilers can't, even counting LTO
Anonymous
go compiler is awesome too but the language has so many limitations. But for what it is being used for, the language is good enough
Kartik
very useful info
GodXAnubis
Brainium
Is CGreen the best for unit testing in C/C++? Is it better than Check, CppUnit?
Anonymous
I usually use Unit tests from Microsoft in visual studio, or Google tests
Pavel
How can I check properly if a variable passed as universal reference to a templated function is actually bound to rvalue reference in an instantiation of a template? Example: template<typename T> void myFunc(T&& var) { if constexpr (my_check_here<T>()) { // work as with rvalue ref } else { // work as with lvalue ref } } if I replace my_check_here<T>() with std::is_rvalue_reference<T>::value then the check always fails However if I replace it with std::is_rvalue_reference<decltype(added)>::value then it works as expected What am I missing in the first check example? (UPD: actually it works even without std::forward)
Anonymous
Thanks, that's interesting so T&& is also forwarding reference in this case?
T&& will use the reference collapsing rules again to deduce the actual type of the universal reference parameter.
Anonymous
If the argument was a lvalue of type U, then T&& will collapse to U&. If it were a prvalue, it will collapse to U&&. So is_rvalue_reference_v will return the correct value.
Pavel
If the argument was a lvalue of type U, then T&& will collapse to U&. If it were a prvalue, it will collapse to U&&. So is_rvalue_reference_v will return the correct value.
Hm, interesting But what if I, for some reason, want to use somewhere in my function rvalue reference type of T in both cases, when it called with lvalue or rvalue ref? Should I use decltype(std::move(var)) or there's still a way to say "rvalue ref of T" even though T&& can't be used for that?
Engineer
Is it worth getting the following book Bjarne Stroustrup Design and Evolution of C++, The 1st Edition ISBN-13: 978-0201543308, ISBN-10: 0201543303 https://www.amazon.com/Design-Evolution-C-Bjarne-Stroustrup/dp/0201543303
Anonymous
Isn't this a much better book? It claims to be beginner friendly https://www.amazon.com/Programming-Principles-Practice-Using-2nd/dp/0321992784/
Vignesh
Can any one help me with generating random number between -1,1 using rand() function
Anonymous
Is it worth getting the following book Bjarne Stroustrup Design and Evolution of C++, The 1st Edition ISBN-13: 978-0201543308, ISBN-10: 0201543303 https://www.amazon.com/Design-Evolution-C-Bjarne-Stroustrup/dp/0201543303
This is for understanding the reason behind why C++ was designed the way it is. This is not a beginner's book. It will teach you why references were introduced, how templates were originally designed and how it turned out and so on.
F R E D
Hello is there any spammer here ?
Nikunj
Probably yes
Who is that
Mг.Շгเקקเn
#include <iostream> using namespace std; int main() { float d; d = 54 / 7 ; cout << d; return 0; }
Himanshu
#include <iostream> using namespace std; int main() { float d; d = 54 / 7 ; cout << d; return 0; }
#include <iostream> using namespace std; //Compiler version g++ 6.3.0 int main(){ float d; d = 54/7.0; cout<<d; return 0; }
F R E D
Probably yes
Please kinky dm me ASAP
klimi
Who is that
Beats me, if I knew I would ban ¯\_ (ツ) _/¯
klimi
20BCS5685_AnishaKumari
Can anyone help mo out with this? For an array declared as int arr[50], calculate the address of arr[35], if Base(arr)=1000 and w=2.
20BCS5685_AnishaKumari
*me
Anonymous
I need the coding part, if possible.
You can calc' it without code
Dr
I need the coding part, if possible.
Bruh simply use that same method as an equation i.e base+(w*position-1)
Brian
#include<iostream> #include<cstring> #include <vector> #include <algorithm> #include <string> using namespace std; class Base{ char num_greater_nine(int declare_numValue1); void strev(char *str); public: string results(int declare_numValue2,int recall_numValue1); }; char Base::num_greater_nine(int declare_numValue1) { if (declare_numValue1>= 0 && declare_numValue1<= 9) return (char)(declare_numValue1 + '0'); else return (char)(declare_numValue1- 10 + 'A'); } void Base::strev(char *str) { int length_Char_array = strlen(str); int i; for (i = 0; i < length_Char_array/2; i++) { int j=length_Char_array-i-1; char hold_value = str[i]; str[i] = str[j]; str[j] = hold_value; } } string Base::results(int declare_numValue2,int recall_numValue1){ char x[100]; int declare_numValue=0; while(declare_numValue2>0){ x[declare_numValue]=num_greater_nine(declare_numValue2%recall_numValue1); declare_numValue2=declare_numValue2/recall_numValue1; declare_numValue++; } x[declare_numValue]='\0'; //cout<<"x:"<<x<<endl; strev(x); //cout<<"X1: "<<x<<endl; return x; } int main(){ int number,base; Base B; cout<<"Enter a number :"; cin>>number; cout<<"Enter base:"; cin>>base; cout<<number<<" to base "<<base<<" is "<<B.results(number,base); } Finally I managed the binary conversation code, from base 10 to any base
Hamidullo 🇺🇿
Hello guys. I have a big question. Can I create anything with c++ programming language? How? What about other language? I have searched it from google but i can not find enough answer. And if I am going to create absolutely new programm how i can this? Thanks for answers
Anonymous
If you want to create something like a website, you should learn PHP/Python and the usual for frontend such as HTML/CSS/JS
Anonymous
c++ is more suited for programs and applications in my opinion.
Pradevel (Pratyush)
++
You here? 😳
Prince Of Persia
Prince Of Persia
github.com/A404M/SL A simple compiler and VM
ɛ n h ᴀ n c ɛ ґ 🧟‍♂️
Hey guys Really need help with something if anyone can help me