klimi
isn't the assembly connected to the hardware you are writing it for? can you address via DS?
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
hy guys, so I have a single-linked list, and I want to write a function that removes the nodes; the point is, we must do it with double pointers to the head node of the list, thus reducing the amount of code needed. So, until now, I wrote this donw: given the fact that my list is given to the function remove() with the address of a pointer to its first element, we have void remove(typeNode **head, unsigned key){ typeNode **curr= head; // making a copy of the head pointer; // Now I'm searching the node that exposes the right key in input to the function: while (*curr && curr->key != key) curr= &(*curr)->next; // As I find the needed node, I'll remove it: if (*curr) *curr= &(*curr)->next; free(*curr) // some doubts on this one: do I have to free curr or *cur? where typeNode is the given struct: typedef struct node{ struct node *next; unsigned key; } typeNode; thank to the ones who will help me!
Anonymous
I can't use C graphics on a old laptop running windows 7; Is there a turnaround or upgrading is the only solution?
artemetra 🇺🇦
I can't use C graphics on a old laptop running windows 7; Is there a turnaround or upgrading is the only solution?
wdym by C graphics? i'm sure OpenGL still runs there if you are speaking of it
Anonymous
nope pure orthodox graphics program ancient actually you know like #include<graphics.h> gdriver gmode and initgraph etc...
Anonymous
I know O sound ridiculous but that's what we're being taught about these days ☺️
artemetra 🇺🇦
nope pure orthodox graphics program ancient actually you know like #include<graphics.h> gdriver gmode and initgraph etc...
graphics.h is an ancient DOS library, you literally need to downgrade your pc to use it
Pradevel (Pratyush)
Anonymous
nope last time it ran fine on windows 10 but the BGI window doesn't cope with windows 7 or that's what the case I presume
Anonymous
where are you taught that?
in our dear ancient university
artemetra 🇺🇦
in our dear ancient university
https://stackoverflow.com/questions/7860569/how-can-i-get-and-use-the-header-file-graphics-h-in-my-c-program
artemetra 🇺🇦
So I can use my Mac M1 chip?
can't guarantee anything, i've never tried it actually
Kalpit
5. What will the result of num variable after execution of the following statements? int num = 58; num % = 11; Marked Answer: 11 Correct Answer: 3
Kalpit
can anyone tell me how this is work
David
num % what?
David
There is supposed to be something after num % and a number = 11
Anonymous
So I can use my Mac M1 chip?
yeah ofcourse just make sure you're using code blocks for Mac
David
David
I use Xcode to write my C program
David
Sometimes sublime text or abs code
Anonymous
then you'd usually have a hard time setting up
Anonymous
take my advice font try it its way much obsolete to learn proceed if....... YOU_KNOW want to know about some history
Anonymous
😂
Anonymous
For Xcode?
YouTube might help
David
Ok😂
artemetra 🇺🇦
same goes for +=, -=, *=, /= etc.
Kalpit
artemetra 🇺🇦
so hows the answer is 3 ?
do you know what the % does?
Kalpit
do you know what the % does?
yes this is use for a DIVISION
artemetra 🇺🇦
Kalpit
ISN IT
artemetra 🇺🇦
% is remainder of division
artemetra 🇺🇦
so if num is 58, and you do num % 11, you are doing 58 % 11, and you are finding the remainder after dividing 58 by 11, which is 3
Kalpit
OHH OK
Kalpit
thank you
Kalpit
thank you for the info
olli
I'm confused in how many ways to declare a friend function ;
This shows how you use the friend declaration https://en.cppreference.com/w/cpp/language/friend
David
yes this is use for a DIVISION
% is modulus and it prints the remainder
Sonny
Anyone know of a resource where I can pay a C++ tutor to help me with a project?
M
what happend
Fanuel
some one tell me how check prime numbers in c++
Sonny
some one tell me how check prime numbers in c++
Start your research here: https://inventwithpython.com/rabinMiller.py
Sonny
some one tell me how check prime numbers in c++
It's python, but easy to read psudo code to recreate in c
Sonny
👍tax
No problem, and here's more info on the math: https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test
Leovan
It is possible to create 3D vertex for vertices buffer object in SFML? Docs has only constructors for 2D, so i need to use natively OpenGL for this?
%Nikita
While we are working with linked lists, we use something like this: element = element->next; To take next list element by it’s pointer. I notice that if we want to add number to a variable we use += operator: a += b; And &=, |=, ^=, -=, %=, *=, /= etc. All this operators have the same structure: variable = variable action value; variable action= value; It is a long and short hand of doing things - two different ways. But how to write short hand with -> operator? Something like ->= - there isn’t such operator in C. It will be cool to write: element ->= next; Like: give me a field “next” from pointer element, and replace element value with it. I came up with this definition: #define replace(e,n) ((e) = (e)->n) It will be cool to have ->= operator, then I want to implement small C preprocessor to make it real. What do you guys think, do we really need this stuff, or it is useless?
Anonymous
I actually understood what was wrong the header file I'm using is so absolutely pre-historic that my .exe file is actually treated as a virus 🤣 by windows defender
Anonymous
And on clean images that only have MSVC installed, nothing else.
%Nikita
AVs are a scam lol happens to me all the time :(
Yes, but I actually think my compiler was sus, and it writes virus to my compiler exe
Anonymous
Yes, but I actually think my compiler was sus, and it writes virus to my compiler exe
Could be the case that cl.exe is sussy on your machine, but mine was on a clean machine!
Sñeha
Which compiler do you use?
Anonymous
Installed Win10, then downloaded VS and that's it
Anonymous
And still detects sometimes my binaries (even on release) as trojans
Anonymous
Write a program in C to get input time in second and convert it into Hours, minute and second..
Anonymous
I think C/C++ had made some unpleasant enemies discreetly
Sarah
Hello, I have a question. I am studying a computer drawing course using the opengl library, but I can't find the code that I often search for. Is there a site that serves this thing? Also, is there a C++ editor that uses this library by default without installing it?
klimi
Hello, I have a question. I am studying a computer drawing course using the opengl library, but I can't find the code that I often search for. Is there a site that serves this thing? Also, is there a C++ editor that uses this library by default without installing it?
Hello, as for opengl i really like https://learnopengl.com/ . As for c++ editor with default libraries... you could use skeletons for opengl, they are many for cmake or even make like https://github.com/redclo/OpenGL_CMake_Skeleton
Sandeep
If i want to implement a double linked list using oops how would I do that