Mihail
Mihail
And I don't think you should be dereferencing them when doing that swap
Anonymous
Mihail
Read the message below
Mihail
If it again doesn't work can you paste the new code in a pastebin?
Anonymous
It is an exercise from a book, I should not change the function names and parameters
Mihail
I haven't told you to change those
Mihail
Here inside the function why are you dereferencing the pointers?
Anonymous
I dont understand. since they are pointers, shouldnt I dereference them
Anonymous
I guess I found the problem
Anonymous
I should call the swap function like this: swap(&array[j], &array[j+1]);
BinaryByter
you shall?
Anonymous
Now it prints everything properly, but sorting is wrong :D
Anonymous
I’ll ask my teacher tomorrrow, thank you guys...
Anonymous
I arranged it, still doesnt work correctly
Anonymous
i<size-1 and j<size-1 this is how it should be, correct?
Anonymous
Okay thanks
olli
and in swap
Anonymous
Omg
Anonymous
What a stupid mistake :D
Anonymous
It works now, thank you so much...
olli
Anonymous
You are right, I am a dumb...
Mihail
olli
Mihail
Anonymous
im looking for someone to help me thru c++
Anonymous
hey, is the sentence "Gets the items' count" right? I don't speak english and i don't know.
I want it for the documentation, and haven't seen any same sentence by anyone while searching. sorry i'm asking here.
Anonymous
i mean the grammar
olli
Anonymous
Anonymous
so what is technically right 😶
Anonymous
i'm so obssesed..
Anonymous
olli
olli
like this?
Anonymous
oh well thanks! 😁 you're so active btw
Anonymous
but, is it wrong if i type "items' count" ?
olli
I think grammar wise using ' is fine as well.. although I'm not a native english speaker
Nehemiah Aklil
hi coders
Nehemiah Aklil
I have a qsn should I install Visual studio commutinty version or Visual studio 2010 ultimate veriosn
Nicola
good evening, does anyone know how to exchange the order of an array and save the initial position to go back to the old order?
olli
olli
Nicola
For example 123456789 -> 952713486
Nehemiah Aklil
Nicola
Nicola
I exchange the position of the array and save the initial position for going back to the old order
Anonymous
save the changes? why?
Anonymous
Ctrl+Z?
Anonymous
like swapped_items.push_back(pair(index1, index2));?
olli
No
Then add more context please. Why would a copy not suffice?
Either use a list to store or a map to project the changes made. If you are going to change most of the items copying the array might still be faster. Depending on the implementation reverting can be done in O(1)
Nicola
Nikk
Yes I am human
Aspire
Double x, int y, int z
x /=z
y/= z
Return x+y
x is 9, y is 14, z is 4
I got the ans 5.25
Buht when i solve this on calculator the comes 5.75
Why the ans is not same in c++
Aspire
It comes*
olli
Heenim
can somebody help me with this?
https://github.com/akodorayaki/hanim/blob/master/README.md
Heenim
last monday it's work just fine.. but it's started to make a problem on tuesday. i didn't even change the code.
Talula
Heenim
We have arduino room?
Heenim
It keep showing the authorize token for Blynk app instead of the sensor's value
Aspire
olli
Aspire
What is formula of squareArea??
Aspire
That mean height * width ??
olli
Yes, since the sides of a square have the same length it's you can take the square of it
Aspire
Ok
Anonymous
How can I use the Object Oriented C (ooc) toolkit?
Anonymous
I have following *.h files,
Anonymous
Anonymous
when i execute the code
Anonymous
/#include <stdio.h>
#include <ooc/ooc.h>
DeclareClass(String1, Base);
ClassMembers(String1, Base)
char * cstr;
EndOfClassMembers;
typedef struct String1Params
{
const char *cstr;
} String1Params;
int main()
{
ooc_init_class(String1);
int i = 0;
printf("%d", i);
}/