+ 1
How can i get my expected output at this code?
https://sololearn.com/compiler-playground/chJ1UqjkdfR8/?ref=app [Expected output] (stdout)[SHLVL=0 HBTN=Holberton ](Length: 23) (stderr)[](Length: 0) (status)[0] What should i do to get this expected output
3 Respostas
+ 3
Abdullah Özden the Sololearn environment does not have a way to import custom .h files. You will have to copy the contents of the header file, main.h, into your code.
Also, getline() seems to be unsupported here. Your code works if you make the above change and replace getline(&buffer, &bufsize, stdin) with fgets(buffer, bufsize, stdin).
+ 2
is this what you're trying to do?
#include "stdio.h"
int main(int argc, char **argv, char **envp){
for(char **env=envp; *env != 0; env++){
char *thisEnv = *env;
printf("%s\n", thisEnv);
}
}