klimi
isn't the assembly connected to the hardware you are writing it for? can you address via DS?
David
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
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 🇺🇦
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 🇺🇦
artemetra 🇺🇦
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
David
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
Anonymous
David
David
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
David
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
Kalpit
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
David
David
Anonymous
take my advice font try it its way much obsolete to learn
proceed if.......
YOU_KNOW
want to know about some history
Anonymous
😂
David
Ok😂
klimi
artemetra 🇺🇦
artemetra 🇺🇦
same goes for +=, -=, *=, /= etc.
Kalpit
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
Sonny
Anyone know of a resource where I can pay a C++ tutor to help me with a project?
Anonymous
M
what happend
Fanuel
some one tell me how check prime numbers in c++
Fanuel
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?
I use Arch
David
%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?
Parra
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?
well, if you want to learn about writing a preprocessor, why not?
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
%Nikita
%Nikita
Anonymous
Anonymous
And on clean images that only have MSVC installed, nothing else.
%Nikita
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?
Anonymous
klimi
Sandeep
If i want to implement a double linked list using oops how would I do that