niko
niko

Reputation: 9393

Syntax error in C program

#include < stdio.h >

int main() {
    char *s;
    s=call();
    printf(s);
}

char* call() {
    return("hello");
}

Why these code not working. It's generating an error. How do I make it work?

Upvotes: 1

Views: 8395

Answers (1)

Rafe Kettler
Rafe Kettler

Reputation: 76965

Two things:

  • You can't put spaces inside the angle brackets when including a system header (e.g. #include <stdio.h>
  • You need a prototype for call()

Upvotes: 2

Related Questions