Anonymous
Guys Where i can download c++
Anonymous
Guys Where i can download c++
You can only buy it on ISO website
Anonymous
Thanks bro
Pavel
Guys Where i can download c++
Simplest way would be: On windows you can install Visual Studio, it comes with MSVC compiler. On linux I guess you should have g++ installed with the distributive. On mac, you can get xCode.
Anonymous
I am win 10
Pavel
I am win 10
If you OK with installing rather heavy software (not running on a potato-pc) you can try this https://visualstudio.microsoft.com/vs/
Anonymous
Hahahaha potato pc
Anonymous
Can eat
Pavel
Hahahaha potato pc
During installation it will ask what to install, make sure C++ is selected
Anonymous
Ok thanks bro
ברני
Hey, I'm in argue with my friend, I remember that on C you're not soppuse to do "void main" and even Microsoft said that, someone has the explain why?
Sourabh
Hey, I'm in argue with my friend, I remember that on C you're not soppuse to do "void main" and even Microsoft said that, someone has the explain why?
It's legend wait-for-it dary to use int return type so as to know if the program exited successfully or any failure occurred. By assigning different numerical values like 0 for success and others for different kinds of error, we can determine the exit status of the program.
Ade
Hi
Ade
I want to learn
Asad
Do it 👍
MAC
Hello all
MAC
I'm beginner in Linux sys programming, can you explain me how does ioctl work ?
MAC
What do I need it for ?
Arminio
I am win 10
YOU are Windows 10? Finally I found you...
Anonymous
I'm beginner in Linux sys programming, can you explain me how does ioctl work ?
you mean kernel programming or os programming ? ioctl is a systemcall .It is used to control devices from user space (like an interface between kernel space user space).
Anonymous
what do you mean by device files ? you mean device drivers ,char devices ?
MAC
dev/tty for example
Anonymous
they are devices.
Anonymous
like /dev/null and dev/urandom
Anonymous
Ex: if you want to get mac address of nic ,you can use ioctl for this.
MAC
Ex: if you want to get mac address of nic ,you can use ioctl for this.
Turn out if I need give some commands to devices then ioctl ?
Anonymous
Turn out if I need give some commands to devices then ioctl ?
pre defined commands ? If it is not ,you want implement ioctl function in kernel space .
MAC
pre defined commands ? If it is not ,you want implement ioctl function in kernel space .
No I just don't understand difference between device files and ioctl, if I need use printer I can open device file , but also I can send commands with ioctl
Anonymous
ioctl is a system call.Device files are device drivers(in /dev) . Ex: if ioctl is implemented in printer driver ,you can use ioctl to control devices at userspace.
MAC
ioctl is a system call.Device files are device drivers(in /dev) . Ex: if ioctl is implemented in printer driver ,you can use ioctl to control devices at userspace.
If I want to read information from eth0 Chanel can't I use system call "fopen" after "read" file from it ? directly without ioctl ?
MAC
ioctl is a system call.Device files are device drivers(in /dev) . Ex: if ioctl is implemented in printer driver ,you can use ioctl to control devices at userspace.
But also can you explain what does mmap use in sys programming for ? I understand that it show file in process memory and you can change it from it
MAC
C++ imo
C and C++ are a difference , C++ has OOP but C don't, they are almost the same
Pavel
C and C++ are a difference , C++ has OOP but C don't, they are almost the same
I wouldn't say they are almost the same, there are a lot more differences than classes+inheritance
Diego
You can follow the exact same programming paradigm that C uses without ever having to delve into OOP, despite the fact that OOP is incredibly useful and comfortable for most applications And virtually everything that can be done from C, can be done from C++
Diego
It's just better, imo
Igor🇺🇦
Which differences can you count ?
Classes, templates, standard library, lambdas, namespaces, function overloading, constructors and destructors for starters
Diego
Which differences can you count ?
new and delete for starters, class/struct methods, scoped enums, templates, STD, namespaces, overloading...
MAC
You can follow the exact same programming paradigm that C uses without ever having to delve into OOP, despite the fact that OOP is incredibly useful and comfortable for most applications And virtually everything that can be done from C, can be done from C++
#include <stdlib.h> #include "point2d.h" typedef struct private { int x; int y; } private; static int getx(struct point2D*p) { return ((struct private*)(p->prvtPoint2D))->x; } static void setx(struct point2D *p, int val) { ((struct private*)(p->prvtPoint2D))->x = val; } point2D* newPoint2D() { point2D* ptr; ptr = (point2D*) malloc(sizeof(point2D)); ptr -> prvtPoint2D = malloc(sizeof(private)); ptr -> getX = &getx; ptr -> setX = &setx; // .... return ptr; }
Diego
And also the biggest difference is that with classes+inheritance you can do type abstraction
Diego
And type abstraction, overloading, class methods, etc, are all vital for true OOP C's OOP practices are nothing but an emulation, specially because of data hiding
Pavel
Which differences can you count ?
Just what I can remember: references, safer type casts, function and operator overloading, built-in namespaces, templates and template metaprogramming, compile-time evaluated functions, lambdas, smart pointers, type traits, RAII. A standard library containing a lot of ready-to use generic but very performant containers and algorithms.
Pavel
It's not true OOP
What is "true OOP"?
Diego
What is "true OOP"?
As the four most basic points of OOP, it would be a language that has, at language level: Encapsulation, Abstraction, Inheritance and Polymorphism
Vlad
It's not true OOP
It's as true as you're willing to implement it in C
💯💥
Hello, I ask for a program on encryption and decryption in C ++ language
PO
HI who has ever worked with Valgrind to check leak-memory?
PO
I want just be sure if I have understood right
Pavel
I want just be sure if I have understood right
What exactly? I think many people here worked with it
PO
==5772== ==5772== HEAP SUMMARY: ==5772== in use at exit: 0 bytes in 0 blocks ==5772== total heap usage: 3 allocs, 3 frees, 1,520 bytes allocated ==5772== ==5772== All heap blocks were freed -- no leaks are possible ==5772== ==5772== For lists of detected and suppressed errors, rerun with: -s ==5772== ERROR SUMMARY: 51 errors from 22 contexts (suppressed: 0 from 0)
PO
I don't have any memory leak?yes? I tested my program in case of error
Igor🇺🇦
Hello, I ask for a program on encryption and decryption in C ++ language
Do you mean library? https://botan.randombit.net/
Anonymous
/get cbook
Henry
Hi do I really need to study pure maths or read up an algorithm book as a programmer?
Anonymous
Henry
😔
Anonymous
new and delete for starters, class/struct methods, scoped enums, templates, STD, namespaces, overloading...
> new and delete for starters Using them in most cases considered a bad practice in modern C++
Diego
Diego
Makes sense, now that I think about it I often use normal malloc and placement allocation because of exactly that
Diego
Though I have yet to work on a desktop C++ application, so far I've only worked on embedded systems
Anonymous
Hello can you please explain How to check that if a number is 3 digit in c++
Ali
Hello can you please explain How to check that if a number is 3 digit in c++
Is that a question? Compare your number with lowest and highest possible 3 digit number that can exist 100 and 999