Dima
ye ik
Dima
idc
Anonymous
😂
olli
hi, i'm reading one byte from a file, so i use a char for the datatype, however, i need to compare it to integers, rather than actual ascii characters, if i cast it to an int - it would take 4 bytes now, so i'm unsure if it'll work. how do i compare them? because i highly doubt there's a 1 byte int
just compare the char, it's basically a 1 byte integral value. ASCII is just a way to interpret the value, Depending on how you compare the values (int)(char)123 == 123 is completely fine becauuse 123 can be represented as both int and char and the value is the same
Ash
Hello we are working our thesis this semester and our project is all about programming... Can anyone give me tips on how do we program Face unlock detection? Do C++ work on that? Or does there any programming software for face unlock detection?
Talula
Hello we are working our thesis this semester and our project is all about programming... Can anyone give me tips on how do we program Face unlock detection? Do C++ work on that? Or does there any programming software for face unlock detection?
What do you mean face unlock? Do you want to program in Android or want to control the Lock Screen or do you want to make it in Linux or Windows… Yes, you can do face detection using libraries but what do you mean by face unlock?
Talula
We will use it for security system like volt etc.
Is it a PC based security system?
Anonymous
Anonymous
Is that error!?
not really an error
rystik
Hh
Prabhat
can anyone tell me how can I make a basic C++ gui app completely from scratch without using any framework?
Prabhat
I've made a couple of small projects with Qt but it has pretty much everything needed already
Prabhat
I wanna understand the core working
Anonymous
Anyone want his own app?
Pavel
can anyone tell me how can I make a basic C++ gui app completely from scratch without using any framework?
Standard libabry of C++ doesn't provide tools to create/manipulate windows, render graphics handle mouse/keyboard input, so you probably will need some libraries anyway. Side note: just as alternative to Qt, you can have a look at wxWidgets. As far as I know it's a simpler framework than Qt. Returning to the question, as you said, you don't want any framework, then I would suggest first to look into SDL2. This library allows to do crossplatform graphical apps, work with input, create windows. But as far as I know it doesn't have support for native window elements. So you would need to draw everything from scratch. There can be other libraries out there that are more helpful for UI, or more suited for your situation. If you want to go really without any libraries, then you would need to work directly with tools that your OS provides (for windows it's WinAPI).
Engineer
I came across the following: unsigned MAX_INT = 2147483647; int some_code(std::string x) { int h = 13; for (unsigned i = 0; i < 3; i++) { h += h * 27752 + x[i]; } if (h < 0) h += MAX_INT; return h; } Anyone come across this type of strange code which does not do what you expect it to?
Pavel
I came across the following: unsigned MAX_INT = 2147483647; int some_code(std::string x) { int h = 13; for (unsigned i = 0; i < 3; i++) { h += h * 27752 + x[i]; } if (h < 0) h += MAX_INT; return h; } Anyone come across this type of strange code which does not do what you expect it to?
Looks like some custom hashing (but only for 3-symbol strings). It can create signed int overflow which is UB. > Anyone come across this type of strange code which does not do what you expect it to? There's a lot of strange code that I've seen that I don't understand, so yes :)
Shubh
Can someone tell me the best course for data structures and algorithms using c/c++
Ludovic 'Archivist'
Can someone tell me the best course for data structures and algorithms using c/c++
As much as I love teaching, you seem like the kind of impatient learner that would get on my nerves if I took you in as a student
Ludovic 'Archivist'
And as good of a teacher I may be, I am not the best because a "best" course is a fallacy
Shubh
Okay okay You guys just suggest me some courses...😊
Anonymous
..
You don't send constant reminders for your question. You should ask a question and wait for someone to reply.
Anonymous
Can someone tell me the best course for data structures and algorithms using c/c++
As regards your question, data structures and algorithms are mostly language agnostic. So pick up a good book or follow a good course on online learning sites and try implementing them in a language of your choice.
Ludovic 'Archivist'
Okay okay You guys just suggest me some courses...😊
https://lmgtfy.app/?q=c%2B%2B+datastructures+algorithms+course
Shubh
As there is no bound checking in arrays ....if I assign a new value outside the array can it cause any harm to other programs running?
Anonymous
As there is no bound checking in arrays ....if I assign a new value outside the array can it cause any harm to other programs running?
It will not affect other programs. It will affect your own program and that is why it is called Undefined Behaviour. No one can know for sure how it would affect your program.
Shubh
Yes everytime I get a new type of crash...
Anonymous
As there is no bound checking in arrays ....if I assign a new value outside the array can it cause any harm to other programs running?
Having said that, it is however possible for malicious programs to affect your program knowing that you have a out of bounds access in your code. This is a vulnerability that can be exploited
Shubh
Is there any way to catch it..
Anonymous
Is there any way to catch it..
Use a bounds checking sanitizer provided by your compiler.
Anonymous
can anyone tell me how can I make a basic C++ gui app completely from scratch without using any framework?
You need to use the posix api and implement them at a low level and use the x server if you’re using that it’s gonna take a long time so just use a framework
Anonymous
hi, i'm reading one byte from a file, so i use a char for the datatype, however, i need to compare it to integers, rather than actual ascii characters, if i cast it to an int - it would take 4 bytes now, so i'm unsure if it'll work. how do i compare them? because i highly doubt there's a 1 byte int
I did not understand correctly، did you want read a 1 byte integer(number) from a file? or what? You can defenation a new custom type For instance 1 byte data type(signed) typedef signed char BYTE; for unsigned(can only store positive numbers) typedef unsigned char BYTE;
Anonymous
can anyone tell me how can I make a basic C++ gui app completely from scratch without using any framework?
You can not, imagine you wanna create a game whitout any game engine , ya may be can but you will need first build a some thing like that framework(QT , gtk+ ,etc) It is not good idea
Jasur Fozilov 🐳
can anyone recommend me oop c++ book ?
Devjit
Somebody tell me how to install this driver https://github.com/openwrt/mt76
Devjit
Giving command make givers error no specified targets
Anonymous
Somebody tell me how to install this driver https://github.com/openwrt/mt76
Check the openwrt page. They may have instructions to build the driver. You can't just pull a single project and hope to build it. The makefile inside the mt76 folder itself should give you an idea that it is not a standalone build.
DEV 7
#include<iostream> using namespace std; class complex{ int real, imaginary; public: void setdata(int x, int y){ real=x; imaginary=y; } complex sum(complex o1, complex o2){ class complex res; res.setdata(o1.real+o2.real,o1.imaginary+o2.imaginary); return res; } void display(){ cout<<real<<"+"<<imaginary<<"i"<<endl; } }; int main(){ complex c1,c2,c; c1.setdata(4,5); c1.display(); c2.setdata(8,7); c2.display(); c.sum(c1,c1); c.display(); return 0; }
DEV 7
why this code not working it gives runtime error
Anonymous
Reinstall VS. It never ceases to amaze me how people eff' up an installation so simple.
Anonymous
I dont wanna do it to make projects that make sense. I wanna make something minimal to know how it really works.
Sorry i do'nt have enought Experience to help you , but i recommend you read the open source GUI frameworks (like gtk+) and documentations
Ali
Hey mans
Ali
I need help to c++
Ali
Beginner level
Ali
Do you have any pdf for beginners?
Anonymous
It's a permissions issue
Anonymous
Anyone good in coding pls message me
Anonymous
Anyone good in coding pls message me
What about? Project? Home work?
touhou
Anyone good in coding pls message me
Read the pinned rules first.
Emirlan
hello guys! i have a bitset<50000> and i need to put its first element at the end of it. is there a way to do it without creating temp variable?
Emirlan
and i also have to delete first element after moving it to the back
Sidharth Singh
Hey:)
Sidharth Singh
I want to learn C using a smartphone
Sidharth Singh
Can I??
Captain
Can I??
Yes you can but online compilers or apps are not that reliable plus coding on phone would be less productive according to me. Its upto u :)
Sidharth Singh
I want to learn basics and after initial stages I'll be having a laptop.
Sidharth Singh
Which apps do I need? And where will I get the resources
Captain
Which apps do I need? And where will I get the resources
About the resources the internet is your Friend there are tones of site like geeksforgeeks, tutorials point etc. As far as apps idk sorry.
Madhav
Which apps do I need? And where will I get the resources
C++ you can do from "apna college" YouTube channel... And use online gdb compiler c++ on your phone
Sidharth Singh
What app is CppDroid??
Anshul
Which apps do I need? And where will I get the resources
I think if you are not in any hurry it's better to start learning from a book And if you don't have much time it's more better to go for some paid courses.