• AVR Freaks

Hot!How to use #include

Page: < 12 Showing page 2 of 2
Super Member
  • Total Posts : 401
  • Reward points : 0
  • Joined: 2019/04/16 22:01:25
  • Location: 0
  • Status: offline
Re: How to use #include 2020/06/29 11:41:25 (permalink)
+2 (2)
The point is if you had just gone to help "multi file C project" you would have got this
Even on the net you would have got something like this
It's a bit like sticking your hand in a blender ... I have heard that people do it but darwinian theory to me.
Just Some Member
  • Total Posts : 3834
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: How to use #include 2020/06/29 11:44:59 (permalink)
+1 (1)
Racist? No.
I just fear fruitless chain mails with people that do not even bother to precisely read the responses.
A huge heap of bad experiences.
And many of the "digital natives" (I tend to "digital naives") are just too lazy or illiterate to read the docs  sad
I know some superb people from Asia, but they are the vanishing minority. OTOH I came to know an aspiring Indian PhD that knew nothing about the field he wants to PhD in. Might be you can buy your PhD in India for cheap...
BTW: I've been the first to respond here. And I think my assessment of your status was next to perfect and the links provided would have helped. Although you're free to express a different opinion  Smile

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
Jan Audio
Senior Member
  • Total Posts : 159
  • Reward points : 0
  • Joined: 2018/09/24 08:12:24
  • Location: 0
  • Status: offline
Re: How to use #include 2020/06/30 08:06:01 (permalink)
0 (2)
Just giving the answer is way simpler.
If all posts was usefull people could find it later and no more questions.
Sorry for the extra useless spam, just give the answer or dont.
Access is Denied
  • Total Posts : 10985
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: online
Re: How to use #include 2020/06/30 08:57:31 (permalink)
+1 (1)
Jan Audio
Just giving the answer is way simpler.
... just give the answer or dont.

Aka taking the easy way out. Somehow, somewhere, the destination becomes more important than the journey. sad: sad
boots too small
  • Total Posts : 946
  • Reward points : 0
  • Joined: 2012/09/10 15:12:07
  • Location: previously Microchip XC8 team
  • Status: offline
Re: How to use #include 2020/07/07 08:37:12 (permalink)
+2 (2)
Jan Audio
just give the answer or dont.

If you don't follow your own advice, why would you expect anyone else to?

Mark (this opinion available for hire)
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2020/06/25 17:34:33
  • Location: 0
  • Status: offline
Re: How to use #include 2020/07/11 20:34:05 (permalink)
Dear OP, let's start simple. As I understand it, be sure to declare functions in a module, before you use them. #include just copies in what's in the included file. So, have your function prototype in an include file such as includes.h

void foo(int a, intb);

Near the top of MyOtherFile.c have the include directive. Double quotes indicate that the include file is in the same directory.

#include "includes.h"

Now in MyOtherFile.c you can have a call to foo( ). Note that without a function prototype the compiler would assume that the function returns an int.
Page: < 12 Showing page 2 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5