Skip to main content

Why do iI not have to link stdio. hh while compiling with clang?

To compile this source code with clang, we had to link "cs50" library like this: clang hello.c -lcs50

but we did not have to link "stdio". why?

----------------
/* hello.c
--------------- */

#include <stdio.h>
#include <cs50.h>
int main(void)
{
    printf("state your name");
    string s = GetString();
    printf("hello, world\n");
}

Why do i not have to link stdio. h while compiling with clang?

To compile this source code with clang, we had to link "cs50" library like this: clang hello.c -lcs50

but we did not have to link "stdio". why?

----------------
hello.c
---------------

#include <stdio.h>
#include <cs50.h>
int main(void)
{
    printf("state your name");
    string s = GetString();
    printf("hello, world\n");
}

Why do I not have to link stdio.h while compiling with clang?

To compile this source code with clang, we had to link "cs50" library like this: clang hello.c -lcs50

but we did not have to link "stdio". why?

/* hello.c */

#include <stdio.h>
#include <cs50.h>
int main(void)
{
    printf("state your name");
    string s = GetString();
    printf("hello, world\n");
}
edited tags
Link
Hakan As
  • 23
  • 1
  • 5
Source Link
Hakan As
  • 23
  • 1
  • 5

Why do i not have to link stdio. h while compiling with clang?

To compile this source code with clang, we had to link "cs50" library like this: clang hello.c -lcs50

but we did not have to link "stdio". why?

----------------
hello.c
---------------

#include <stdio.h>
#include <cs50.h>
int main(void)
{
    printf("state your name");
    string s = GetString();
    printf("hello, world\n");
}