@drone
How to learn c and c++
Beyond
probably watching some courses or tutorials? while you try to understand them you can do some projects to improve your skills in it
^^^
Anonymous
How to learn c and c++
Practice practice practice... It will be very hard to learn much without setting aside lots and lots of time and do reading + coding + code review + other skills.
If you have a family to look after it might be too difficult for some...
1212
..
Anonymous
What’s the best YouTube channel to learn
Jas
Anonymous
Jas
Okay.
Anonymous
Anonymous
Anonymous
Anonymous
Except probably this one
https://youtube.com/c/TheChernoProject
Anonymous
And I fill bad for you that you stick with CodeBlocks because there are a lot of better IDEs than CodeBlocks
^^^
Jas
I've tried a bunch of IDEs. They're like DAWs in the audio world. They're all extremely good these days so The best one is whatever lets you produce code efficiently and comfortably. Super personal choice.
Anonymous
Anonymous
#ides
Anonymous
Even VSCode or Vim with a little bit of spent time to configure them give better ide experience than these ones
Jas
Visual Studio is excellent, thank you very much. Granted if I didn't have a powerful machine I'd probably say otherwise.
^^^
^^^
Jas
It's a lil bulky. Otherwise it's fine. Seriously most modern IDEs are either slightly different Electron based products like VSCode/Atom/Eclipse or a big heavy dev tool like VS2019
Jas
Try out the options, use whichever one you are most productive in. 😎
Dhanny
Hi
Dhanny
Am I welcome here
Anonymous
Someone plz help me in writing a program that uses two functions to calculate &return the volume and the surface area of acylinder
Igor🇺🇦
Jas
Jas
Pretty sure Theia is Electron based
Bumpy
Where can I find examples of Arrays 2D 3D and string questions with solutions?
Bumpy
except GFG
many
Coroutine is introduced in c++20. Do we still need libraries like libuv nowadays?
Also does the C++ coroutine have the same concept as the Python one and Go one?
M
Hello did anyone try to use dns in Xcode ? Can we get ip through there and work with that ip ?
Anonymous
Anonymous
Anonymous
gcc 9.2.0
g++ 9.2.0
Please help me.
Some of my friends are getting no errors whereas I'm getting error in declaring an array with variable no. of elements
for eg
cin>>n;
int arr[n];
Anonymous
My error reads:
expression must have a constant value --the value of "n" (declared at line 4) cannot be used as a constant
Whereas some of my friends using same version of gcc/g++ are getting no errors
Anonymous
Anonymous
and in C?
AHMED
#include<iostream>
using namespace std;
class myClass{
public:
int x , y;
myClass(){
x = 5;
y =6;
}
myClass(const myClass& other){
cout<<"copy constructor called\n";
}
};
int main (){
myClass myObj1;
myClass myObj2 (myObj1);
cout<< myObj1.x<<"\n"<<myObj2.y<<"\n";
return 0;
}
AHMED
Why the output of myObj2.y is 0 not 6?
Anonymous
AHMED
Why would it be 6?
Because myObj2 is created using the copy constructor, so data in myObj1 should have been copied to myObj2
Anonymous
AHMED
Vlad
AHMED
It worked this way:
AHMED
#include <iostream>
using namespace std;
class myClass
{
public:
int x,y;
myClass()
{
x=5;
y=6;
}
myClass(const myClass &other) {
x= other.x;
y= other.y;
}
};
int main()
{
myClass myObj1;
myClass myObj2(myObj1);
cout<<myObj2.x<<"\n"<<myObj2.y<<"\n";
myObj1.x=1;
myObj1.y=2;
cout<<myObj2.x<<"\n"<<myObj2.y<<"\n";
return 0;
}
AHMED
AHMED
#include <iostream>
using namespace std;
class myClass
{
public:
int x,y;
myClass()
{
x=5;
y=6;
}
myClass(const myClass&) = default;
};
int main()
{
myClass myObj1;
myClass myObj2(myObj1);
cout<<myObj2.x<<"\n"<<myObj2.y<<"\n";
myObj1.x=1;
myObj1.y=2;
cout<<myObj2.x<<"\n"<<myObj2.y<<"\n";
return 0;
}
MRT
I think this user should read the book :D
Anonymous
MRT
AHMED
Your way to invite me wasn't good.
You didn't invite me directly.
You said 'this' user .
MRT
AHMED
Ok .
AHMED
Which book should I read ?
MRT
Which book should I read ?
I have done research and I am reading this book, maybe it is a better case that I do not know https://www.informit.com/store/c-plus-plus-primer-9780321714114
MRT
Which book should I read ?
https://raw.githubusercontent.com/yanshengjia/cpp-playground/master/cpp-primer/resource/C%2B%2B%20Primer%20(5th%20Edition).pdf
Anonymous
Who knows good roadmaps for learning C++ from zero?
AHMED
Bumpy
void buildMatrix(int n , int m) {
int Matrix[] = (int*)calloc(n * m,sizeof(int));
for (int i = 0; i < n*m ; i ++) {
scanf ("%d",&Matrix[i]);
}
printMatrix(Matrix,n,m);
}
void printMatrix(int *Matrix, int n , int m) {
for (int i = 0; i < n ; i ++) {
for(int j = 0; j < m; j ++) {
printf("%d ",Matrix[i + j]);
}
printf("\n");
}
printf("%p",Matrix);
free(Matrix);
Hanz
Wait, i havent read them lol
Hanz
Which is better to learn first? C or C++? I've been diving deep into programming but still cant undrstand these main low programming languages
Vlad
Vlad
Use STL to it's fullest since day one
Hanz
Anonymous
Bumpy
void buildMatrix(int n , int m) {
int *Matrix = (int*)calloc(n * m,sizeof(int));
for (int i = 0; i < n*m ; i ++) {
scanf ("%d",&Matrix[i]);
}
printMatrix(Matrix,n,m);
}