Strife
Luca
https://pastebin.com/7ctnSWLa
Luca
I get a problem with atomic, it can't be moved or copied, how can i solve?
Azhar
*++ptr first increment of pointer and than value of that element?
Juli
Help me pls
net
https://www.reddit.com/r/cpp/comments/r7xvd1/c20_coroutine_benchmark_result_using_my_coroutine/
klimi
Danny
Good day group maybe someone to help me with a program in c ++
El consultorio del Dr. Lorenzo T. Mata Lozano
Its policy is to charge for the consultation based on the appointment number, as follows:
- the first three appointments to $200.00 c/u.
- the following two quotes at $150.00 each.
- the next three appointments at $100.00 c/u.
The remaining ones to $50.00 c/u, while the treatment lasts.
An algorithm is required to determine: a) how much the patient will pay for the appointment.
B) the amount paid by the patient for the treatment
I need to do this program but it is
An end module program and I need to perform it as complex as possible to make it great thank you so much for your support
Danny
Sorry
Ludovic 'Archivist'
Ludovic 'Archivist'
Azhar
How to access last element of array using adress/pointer?
Azhar
Azhar
I tried this but it giving me some random garbage adress
\Device\NUL
Azhar
Azhar
Array?
danya
Hello everyone, I need to find words from a file, what is the logic for this, can u tell?
danya
given a lot of words that are not related to the word I need to find
Ludovic 'Archivist'
Anonymous
https://pastebin.com/7ctnSWLa
You shouldn't do this. There is a reason why the standard prevents such things. If you have multiple atomic variables then you need to enforce some mechanism to synchronise changes to them. If you let them be changed independently then your invariants are going to violated which is why the standard does not allow atomics to be copied or moved.
What you should do instead is declare a struct inside your class A like this
struct A {
bool flag;
int i;
};
Then you have to declare a atomic<S> var inside your class A. Given the typical sizes of bool and int on most implementations, this atomic would be lock free but you can check if it is so.
Since you have not given details on why you want to do this, this is as far as I can help.
coal
coal
the size of ptr as a whole / the size of an individual element in ptr
coal
then just do ptr[length-1]
coal
Jobair
can you guys help me?
Jobair
#include<stdio.h>
int main()
{
int i, n, length, width, total=0;
printf("How many rooms in the house? ");
scanf("%d", n);
for(i=1; i<=n; i++)
{
printf("Please enter length and width of a room in feet: ");
scanf("%d%d", &length, &width);
total = total + (length*width);
}
printf("Total square footage = %d", total);
return 0;
}
Jobair
The question is:
Write a C program that computes the square footage of a house given the dimensions of each room.
Have the program ask the user how many rooms in the house and then request the dimensions of each
room. Display the resulting total square footage.
Jobair
My code is not working
olli
How to access last element of array using adress/pointer?
you need to know the beginning of the array and the size
void* getLastItemOfArray(void** Array, size_t Size) {
return Array[Size - 1];
}
iff you have a local static array you can use the sizeof trick, however this does not work for dynamically sized arrays or arrays passed as parameter to other functions.
coal
use %i instead of %d
coal
and separate it by space: scanf("%i %i")
coal
coal
you can't get the size of a dynamic array
coal
you need to keep track of the size
coal
and an octal when preceded by 0
coal
whereover %d only checks for literal digits
coal
i.e. over "031", %d would output 31, and %i would output 25
coal
i rather using %i in general because it parses the literal format instead of just the number, but thats up to your needs
ɛ n h ᴀ n c ɛ ґ 🧟♂️
Jobair
ɛ n h ᴀ n c ɛ ґ 🧟♂️
danya
Can someone tell me how to add to Fputc char, if char = 12(number) and i have "<" but not 12?
coal
coal
thought the problem was that he didnt separate the format codes either
Jobair
Jobair
It works now
Jobair
I didn’t noticed actually
danya
Jobair
Luiz
Nothing
Hello everyone
I'm software student in the first year
I have been asked to give presentation can anyone give me idea of a topic
coal
what field do you know most about
coal
the topic should probably be something you studied already
olli
why not try running it?
klimi
klimi
That's the whole point of pointers
coal
coal
i didnt understand your question at first sorry
coal
you must keep the track of the array size
klimi
Only on the stack the compiler already knows its result
coal
klimi
Malloc doesn't necessary allocate the memory
coal
hmm
coal
i think it does
klimi
Nope
coal
isnt it short for "memory allocate"