Gulnar
Should I use for loop?
Anonymous
/get cbool
Anonymous
/get cbool
Anonymous
/get cbook
Anonymous
anyone to teach me how to run windows files on mac?
Savta
I want to write a command line interface program in c that will run all the time, how do I achieve that?
Savta
The purpose of the program is to catch specific characters/expressions I write and execute them for me
Pavel
Savta
Vlad
Usually I put volatile bool just to be safe
Savta
I just want to write a program that auto-translate chars I write in my language to English when I type them by mistake
Savta
I don't want to execute a program each time I open my terminal
Vlad
Pavel
Where process command is something like reading from cin and ifelseif
Vlad
What if it is pure and doesn't?
Vlad
And you can't tell by reading this snippet alone
Vlad
Vlad
It changes the global state
Savta
But my question is how I achieve the condition where I type in terninal:
"cookie" and the program writes for me "milk".
I know how to achieve that by doing:
./myProg cookie
But how do I skip that stage?
Pavel
B
anyone knows about sql here?
Savta
Savta
Savta
Because I want it to run without me activating the program every time
Vlad
Vlad
B
with dept_num
Pavel
This is not a correct chat to ask about SQL
Anonymous
Is SQL allowed here?
B
B
ok sorry anyway
Pavel
:)
Who knew, your question may have been related to C/C++
B
if someone could help dm please
klimi
you can ask about sql in the offtopic group
Gulnar
Eturnus
hi there! guys, can i get C++ ebook here?
MAC
Anonymous
Gulnar
Hey guys, I have written a program with if statement, and at the end I want to ask for continuing at the same time i want if i write like answer Y or y it starts again but n or N it stops , how can i do it?
Anonymous
Anonymous
Юрій
uint32_t myInt = 123456;
std::cout << std::setfill('0') << std::setw(8) << std::hex << myInt << '\n';
Юрій
Anyone knows how to write it into string variable?
Юрій
Thanks)
Anonymous
Thanks)
corrected a small mistake
ая
site for solving problems especially Pointer (C) ?
Nils
Hi, how does this work without segfault?
int main() {
char *m = (char*)main;
strcpy(m, "Hello world!");
puts(m);
}
Anonymous
Anonymous
It can work any way
Anonymous
It can format your drive
Nils
and isn't it in read-only memory?
Anonymous
Anonymous
Ammar
Nils
Ammar
It segfault from my end anyway:
ammarfaizi2@integral:/tmp$ cat > qwe.c
int main() {
char *m = (char*)main;
strcpy(m, "Hello world!");
puts(m);
}
ammarfaizi2@integral:/tmp$ gcc qwe.c -o qwe
qwe.c: In function ‘main’:
qwe.c:3:9: warning: implicit declaration of function ‘strcpy’ [-Wimplicit-function-declaration]
3 | strcpy(m, "Hello world!");
| ^~~~~~
qwe.c:3:9: warning: incompatible implicit declaration of built-in function ‘strcpy’
qwe.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
+++ |+#include <string.h>
1 | int main() {
qwe.c:4:9: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration]
4 | puts(m);
| ^~~~
ammarfaizi2@integral:/tmp$ ./qwe
Segmentation fault (core dumped)
ammarfaizi2@integral:/tmp$
Ammar
Nils
Nils
right?
Nils
Anonymous
So you like offtoping, right?
Ammar
tcc -run
I don't have tcc, so IDK.
Nils
int main() {
char *m = (char*)main;
strcpy(m, "Hello world! This is a test!");
puts(m);
main();
}
Results in:
Hello world! This is a test!
Segmentation fault
Nils
Nils
A broken keyboard is still a keyboard even though it does not work