Posts by Gilberto Sudario • 11 points
4 posts
-
0
votes1
answer104
viewsA: execute grep command in C language and return result
#include <stdio.h> #include <stdlib.h> FILE *popen(const char *command, const char *mode); int pclose(FILE *stream); int main(void) { FILE *cmd; char result[1024]; cmd = popen("grep bar…
-
-2
votes1
answer104
viewsQ: execute grep command in C language and return result
void main() { char comando[2000]; char resultado[500] sprintf(comando, "grep '[0-9]{50}-' input.txt); resultado = system(comando); printf("%s\n",resultado); } I only need 1 match, and return the…
-
0
votes3
answers282
viewsA: strcpy function does not work on Linux
I changed the data type of the function, and now it’s working, thanks for the help void envia(char *pdados) { char* dados = pdados; char* resultado; size_t len; len =…
-
1
votes3
answers282
viewsQ: strcpy function does not work on Linux
#include <stdio.h> #include <string.h> void envia(char* pdados); int main() { char* link[1000]; strcpy(link,"http://site.com/data.php?dados="); char* dados = "name"; strcat(link,dados);…