This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdlib.h> | |
#include <string> | |
std::string url_decode(char *url) { | |
std::string temp, output; | |
char ch; | |
for (unsigned int index = 0; index < strlen(url)+1; index++) { | |
if (url[index] == '%') { | |
temp += url[index+1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <mariadb/mysql.h> | |
int main() { | |
MYSQL *connection; | |
MYSQL_RES *results; | |
MYSQL_ROW row; | |
connection = mysql_init(NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compile | |
g++ zlib.cpp -o zz -lz | |
# run | |
root@localhost:~# ./zz | |
Orignal string size: 43 | |
Original string: halloweeks halloweeks halloweeks halloweeks | |
-------------------- | |
Compressed string size: 22 |