Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What's the problem in my C program?

Status
Not open for further replies.

vead

Full Member level 5
Full Member level 5
Joined
Nov 27, 2011
Messages
285
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,815
Hello
I wrote program to find largest of three numbers. I am using gcc compiler. When I was compiling first time it was showing some result but again when I tried to complies same program it showing error. Now I don't why it's happening. what's wrong in program or compiler ?

Program


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
int main(void)
{
    int a, b, c, max;
    max = a;
   
    printf(" enter three numbers \n ");
    scanf("%d %d %d",&a,&b,&c);
    
    if(max < b)
 {
        max = b;
 }
    else if(max < c)
 {
        max = c;
 }
  
    printf("\n largest %d ",max);
     
 return 0;
}



Error
hello.c:16:6: error: stray '\240' in program
A A A A A A A A max = c;
^
hello.c:16:7: error: stray '\302' in program
A A A A A A A A max = c;
^
hello.c:16:8: error: stray '\240' in program
A A A A A A A A max = c;
^
hello.c:16:9: error: stray '\302' in program
A A A A A A A A max = c;
 
Last edited by a moderator:

you have special characters that are probably not visible in your text editor but are caught by your compiler. just google 'stray \240' and the very first hit explains it well.
 

you have special characters that are probably not visible in your text editor but are caught by your compiler. just google 'stray \240' and the very first hit explains it well.

I copy paste code, that I have already made because it take a lot of time to write new code every time. I used to do this But then there was no problem. It's been happening for a few days. how to fix this issue
 

whatever you are copying from, it already has the issue in it. very very simple.. I mean, if you can't debug this incredibly naive mistake, how are you going to write software?
 

this situation may happen when the source is in utf and target is ascii edior.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top