Damien
Anyone solve this error ?
Why don't you use IDEs for coding? It's the Far Manager, isn't it?
MᏫᎻᎯᎷᎷᎬᎠ
/report
Ибраги́м
/ban ad: be gone
MᏫᎻᎯᎷᎷᎬᎠ
You are welcome
klimi
Noo
klimi
I wasnt that fast
MᏫᎻᎯᎷᎷᎬᎠ
Too bad
klimi
@JithuJwalk bye, wrong target
Anonymous
https://pastebin.com/NfU79piA
Anonymous
i wrote a function in c that is meant to reverse strings
Anonymous
Anonymous
It doesn't reverse anything
its working on my end
Anonymous
You're just printing values
Anonymous
So what 🤔
nothing really
Mat
nothing really
Oh, okay 👍
Anonymous
its working on my end
So what do you want from us?
Mat
However, a real definition would be "It prints the reverse of the input" :P
Mat
Now continue to work on it
Mat
whats the difference from what i said
It doesn't really reverse anything as it doesn't store it and you can't work with that string 🤷‍♂
Anonymous
Now continue to work on it
for sure, i will for a few hours before work
Anonymous
To clear you doubt: you're just printing string in reverse order But you don't reverse the actual string
Mat
can i store it ?
You can save it in another char array
Anonymous
You can save it in another char array
is there a push operator like in javascript in C ?
Anonymous
in javascript you can create an array, and push values to it
Mat
Nope
Anonymous
i figured C would be easier lol
Anonymous
https://www.quora.com/How-do-I-write-push-and-pop-functions-in-C#targetText=push%20operation%20inserts%20an%20element,in%20first%20out%20(%20LIFO%20).
Mat
i figured C would be easier lol
You can just allocate another array and fill it reading the input string as you're already doing 🤔
Mat
Nothing difficult
Ибраги́м
i figured C would be easier lol
Only if u knew my pains!
Anonymous
Yeah. Those are basic operations 🤔
well i am a basic programmer lol
Anonymous
not visual basic , just learning
Anonymous
Anonymous
the book i am following has this as a template for the exercise but i wrote it the way i did
Anonymous
#include <stdio.h> #include <string.h> void print_reverse(char *s) { size_t len = strlen(s); char *t = s + len - 1; while (t >= s) { printf("%c", *t); t= t - 1; } puts(""); } int main(){ char someString[] = "RACEcar"; print_reverse(someString); return 0; }
Anonymous
this the answer they expected
Anonymous
seem to using pointer math
Anonymous
Oldschool
i dont fully understand why they did it this way
Anonymous
Anonymous
HeadFirst C
Change it
Anonymous
Anonymous
pointer arithmetic , char * t = the first character in the string moved over (length of array) times minus 1
Anonymous
i get that part now
Anonymous
t - 1 moves it to the left a character each time
Anonymous
while (t >= s) this part is a bit confusing
Timothy
i dont fully understand why they did it this way
So actually that way is not even optimized... the code could be shortened even more
Timothy
Can you show me a better, simpler way?
Anonymous
Can you show me a better, simpler way?
https://pastebin.com/NfU79piA
Anonymous
thats what i did , but i think they are trying to show the use of pointer arithmetic
Anonymous
my question is how do you do t >=s if t and s are char pointers
Anonymous
is it comparing length i assuming
Anonymous
What if i need of arrays of each element in array in c++? For use of bucket sort algorithm.
Deepak
Hii
Till
Hii
nohello.com
Anonymous
Best resource for c/c++
Anonymous
Serg from FarCry
How i can change title in VS 2019? This got error: std::string t = "The Title"; SetConsoleTitle(t);
Vishal
Test
Anonymous
Read the docs
Anonymous
Maybey u need this: SetConsoleTitle(L"new title");
Anonymous
std::wstring title = L"The Title"; SetConsoleTitle(title.c_str());
X3eRo0
Does anyone have Ida pro
X3eRo0
I wanna ask about the c++ decompiler output
X3eRo0
Is there any way to make it simpler
X3eRo0
I am greatful for the decompiled output but still
X3eRo0
Some operators can be simplified