Martin
Anonymous
Im talking with Iran citizens. There is a dreadful situation in the country. Slightly reminds Russian model of controlling the human rights and the freedom of speech. I've made mtproxy to help them. The ones was immediately banned😒
How they determine proxies, if I send a link through secured chats, and only personally, with targeted way?
Ludovic 'Archivist'
Your doesn't match 25
Ludovic 'Archivist'
It contains matches to 25 tho
Martin
Ludovic 'Archivist'
Call std::regex_search() with your subject string as the first parameter and the regex object as the second parameter to check whether your regex can match any part of the string. Call std::regex_match() with the same parameters if you want to check whether your regex can match the entire subject string. Since std::regex lacks anchors that exclusively match at the start and end of the string, you have to call regex_match() when using a regex to validate user input.
Ludovic 'Archivist'
Martin
Thanks! Ahh... I messed that part that regex_match matchs the entire thing
Ludovic 'Archivist'
Anonymous
itsmanjeet
how can i link two binaries from gcc compiler
itsmanjeet
i have done gcc file1.c -o file1.o && gcc file2.c -o file2.o
itsmanjeet
these are libraries files
itsmanjeet
i want to create file.so from file1.o and file2.o
BinaryByter
use ld
itsmanjeet
i dont know much about ld, can i do it with gcc , because i have no much idea about linker script
Draco
Hey can anyone help me?
Draco
I need help doing insertion sort on dynamic linked list
Draco
I have tried finding for solutions but they use a static linked list
Draco
Static meaning the nodes are predefined before execution if the program
Draco
That is fixed number of nodes
Draco
Dynamic lets you create or delete nodes during runtime
Draco
I can't get a workaround in the sorting
Draco
This is static. Look the value are in the program first only
Draco
The values need to be taken in from the user and sorted during runtime
Draco
Oh thanks. That will definitely help me
Draco
That gave me an idea
Draco
Tysm
klimi
welcome
Dima
What the..
Parra
what's up?
🐰🐾 سمیه
hi
Parra
i have been summoned
Parra
hello
Parra
😁👍
🐰🐾 سمیه
Parra
how is it going?
🐰🐾 سمیه
🐰🐾 سمیه
Once you told me that I could debug a single function, but I don't know how. Would you please modify this one to teach me how to do that?
🐰🐾 سمیه
https://codepen.io/ebrahimi36655/pen/wOOQwz
Parra
of course, show me
Parra
#include <stdio.h>
int power(int base, int n)
{
int i,p;
p = 1;
for (i = 1; i<=n; ++i)
p = p * base;
return p;
}
int main(int argc, char* argv []) {
int result = power(2, 10);
printf (" 2 to power 10 is: %d\n", result);
return 0;
}
Parra
build this with gcc and run it
Parra
gcc main.c
./a.out
Parra
you can use codeblocks with gcc so you can put breakpoints
Parra
do you use linux?
🐰🐾 سمیه
Yes, Ubuntu
🐰🐾 سمیه
Sorry for late answers, my internet connection is down.
Ariana
:x to quit and save
Parra
:wq
🐰🐾 سمیه
done, what next?
Ariana
:x :>
Ariana
gcc main.c -o main
./main
🐰🐾 سمیه
and Im using GDB to debug programms.
Ariana
gdb main
Ariana
to debug
Ariana
suggestion: use gdb-peda
🐰🐾 سمیه
🐰🐾 سمیه
🐰🐾 سمیه
Parra
Parra
some compilers allow different signatures for main
Parra
for example
Parra
void main()
Parra
or
Parra
int main()
Parra
but the one I show you is the most common
Parra
Ariana
Ariana
to debug it
🐰🐾 سمیه
Parra
you can do the same with other functions
Parra
just following the call and signature / name correctly
Parra
for example
🐰🐾 سمیه
Parra
#include <stdio.h>
int sum(int a, int b) {
return a+b;
}
int main(int argc, char* argv[]) {
int result = sum (3, 7);
printf("result of 3+7 is: %d\n", result);
return 0;
}