From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3358 invoked by alias); 18 Feb 2013 15:18:55 -0000 Received: (qmail 3336 invoked by uid 22791); 18 Feb 2013 15:18:54 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,KHOP_SPAMHAUS_DROP,KHOP_THREADED,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from stargate.mehconsulting.com (HELO stargate.mehconsulting.com) (65.78.188.61) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Feb 2013 15:18:38 +0000 Received: from [10.1.1.70] (Atlantis.mehconsulting.com [10.1.1.70]) (authenticated bits=0) by stargate.mehconsulting.com (8.13.8/8.13.8) with ESMTP id r1IFIbe1008543 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Mon, 18 Feb 2013 07:18:37 -0800 Message-ID: <5122464D.8060103@Winfirst.Com> Date: Mon, 18 Feb 2013 15:18:00 -0000 From: Mark Hansen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: cygwin-xfree@cygwin.com Subject: Re: "Erreur" messages when trying to compile References: <1361197597703-96267.post@n5.nabble.com> <1361198544.5452.0@ffortso4> In-Reply-To: <1361198544.5452.0@ffortso4> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com X-SW-Source: 2013-02/txt/msg00048.txt.bz2 On 2/18/2013 6:42 AM, Jack wrote: > On 2013.02.18 09:26, jere95 wrote: >> Hi, >> I am new to programming and I downloaded cygwin, because I heard it >> was a >> good gcc compiler. At the moment I am reading this O'reilly book on >> C, and I >> tried compiling the folowing exemple programme out of the book : >> >> When I try to compile, this c file, typing : /gcc cards.c -o cards/ , >> the >> cygwin terminal answers : >> >> >> >> What is the problem? > For some reason, your examples are not coming through to the mailing > list. > > However, it looks like the messages are very clear. You seem to be > using "(" (left parenthesis) instead of "{" (left curly brace) on many > lines. gcc is expecting a closing parenthesis before the next > semicolon, and it is expecting a semicolon before the next closing > curly brace. Yes, here is his example program: #include #include int main() { char card_name[ 3]; puts("Enter the card_name: "); scanf("%2s", card_name); int val = 0; if (card_name[0] == 'K') ( val = 10; } else if (card_name[0] == 'Q') ( val = 10; } else if (card_name[0] == 'J') ( val = 10; }else if (card_name[0] == 'A') ( val = 11; }else ( val = atoi(card_name); } printf("The card value is: %i\n", val); return 0; } Look at this line, for example: if (card_name[0] == 'K') ( My guess is that you typed this in by hand, and didn't see clearly that the last character should have been an open brace '{' rather than an open parentheses '('. It looks like you've made the same error in several other places. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/