Error compiling. Problem with my text editor?

This is a discussion on Error compiling. Problem with my text editor? within the C Programming forums, part of the General Programming Boards category; This is a very simple math program and I can't get it to compile for the life of me. I ...

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Error compiling. Problem with my text editor?

    This is a very simple math program and I can't get it to compile for the life of me. I can't find anything at all wrong with it. I'm wondering if it's the text editor I'm using inserting invisible characters into my code.

    Please help.
    Code:
    #include <stdio.h>
         
    int main (void)
       {
          int num1;
          int num2;
          int num3;
          int num4;
          int ans;
    
          printf("\nEnter four numbers in the format nnn nnn nnn nnn\n");
          scanf("%d %d %d %d", &num1, &num2, &num3, &num4); \
    
          ans = ( num1 + num2 - num3 ) * num4; 
    
          printf("\n(%d + %d - %d) * %d = %d\n" num1, num2, num3, num4, ans);
          return 0;
       } // main

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by Sinensis View Post
    This is a very simple math program and I can't get it to compile for the life of me. I can't find anything at all wrong with it. I'm wondering if it's the text editor I'm using inserting invisible characters into my code.

    Please help.
    Code:
    #include <stdio.h>
         
    int main (void)
       {
          int num1;
          int num2;
          int num3;
          int num4;
          int ans;
    
          printf("\nEnter four numbers in the format nnn nnn nnn nnn\n");
          scanf("%d %d %d %d", &num1, &num2, &num3, &num4); \
    
          ans = ( num1 + num2 - num3 ) * num4; 
    
          printf("\n(%d + %d - %d) * %d = %d\n" num1, num2, num3, num4, ans);
          return 0;
       } // main
    I would say that's pretty visible, really. Oh and your compiler should have even told you what line to look at.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    8
    I removed that and still problems. ???

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    8
    Fixed. All is well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 05:26 PM
  2. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 01:59 PM
  3. Help programming a text editor
    By Nongan in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2005, 06:26 AM
  4. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 03:49 PM
  5. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21