🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9266

need help with a delcaration

#9266
From: BJORNDAS%CLARGRAD.BITNET
Date: Sat, 06 Sep 1986 18:36
19 lines
923 bytes
Very simple question here, folks.  What is the correct way to
declare the variable in the called function below:

main()
    {
    char c = 'W';
    foo(c);
    }

foo(ch)
char ch;  /* Or should this be "int ch;" because it gets promoted? */
  {}

On my micro it MUST be declared an int; I think this is screwy, but
I'm not an expert.

---
Sterling Bjorndahl, Claremont Graduate School
BJORNDAS @ CLARGRAD on BITNET
Technical Details
Message-ID: <3594@brl-smoke.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!caip!brl-adm!brl-smoke!smoke!BJORNDAS%CLARGRAD.BITNET@WISCVM.WISC.EDU

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!caip!brl-adm!brl-smoke!smoke!BJORNDAS%CLARGRAD.BITNET@WISCVM.WISC.EDU
From: BJORNDAS%CLARGRAD.BITNET@WISCVM.WISC.EDU
Newsgroups: net.lang.c
Subject: need help with a delcaration
Message-ID: <3594@brl-smoke.ARPA>
Date: Sat, 6-Sep-86 14:36:25 EDT
Article-I.D.: brl-smok.3594
Posted: Sat Sep  6 14:36:25 1986
Date-Received: Sun, 7-Sep-86 03:50:20 EDT
Sender: news@brl-smoke.ARPA
Lines: 19