c
c copied to clipboard
help in C language ..
hello man can you help me in C ? i now how to extract ANCII chars and concaternate them.. what i need to know its how can i execute that ancii string after concaternation ..
example: 1º i what to extract the string whoami from ancii chart 2º concaternate the chars to build whoami command 3º and execute the string concaternated ..
this code does allmost everything.. it extracts the chars, concaternate them ... but it only prints the string .. but i dont what to print ..i want to execute ..
#include <stdio.h>
#include <string.h>
int main(void)
{
/* variable declarations */
char a = 119; /* ancii character w */
char b = 104; /* ancii character h */
char c = 111; /* ancii character o */
char d = 97; /* ancii character a */
char e = 109; /* ancii character m */
char f = 105; /* ancii character i */
/* concaternate and transform decimal values to ancii chars using putchar */
//char command = putchar('a');putchar('b');putchar('c');putchar('d');putchar('e');putchar('f');
/* execute command using system() */
int system(char command);
system(command);
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
/* variable declarations */
char a = 119; /* ancii character w */
char b = 104; /* ancii character h */
char c = 111; /* ancii character o */
char d = 97; /* ancii character a */
char e = 109; /* ancii character m */
char f = 105; /* ancii character i */
/* concaternate and transform decimal values to ancii chars using putchar */
char command[] = {a,b,c,d,e,f};
/* execute command using system() */
system(command);
}
Thanks man ...