added ws202425 courses

This commit is contained in:
Huaqo
2024-11-14 13:11:04 +01:00
parent 800282c2e8
commit beb31897b1
461 changed files with 20368 additions and 0 deletions
@@ -0,0 +1,31 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
char *mywdfunc(unsigned int bufsize) {
if (bufsize < 100) {
return NULL;
}
char *buf = (char *)calloc(bufsize,sizeof(char));
if (buf == NULL){
return NULL;
}
if (getcwd(buf,bufsize-1) == NULL) {
free(buf);
return NULL;
}
return buf;
}
int main() {
char *ret = mywdfunc(512);
printf("%s", ret);
free(ret);
return EXIT_SUCCESS;
}