Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8355647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:55:47+00:00 2026-06-09T09:55:47+00:00

I’m trying to compile this C++ code: #include <stdlib.h> #include <stdio.h> #include <string.h> #include

  • 0

I’m trying to compile this C++ code:

#include <stdlib.h>
#include <stdio.h>   
#include <string.h>
#include "general_configuration.h"
#include "helper_functions.h"

#define LINE_LEN 80

// file_with_as_ext returns 1 if the input has .as extension
int file_with_as_ext(char* input)
{
  char* dot_value = strchr(input, '.');
  if (dot_value == NULL)
    return 0;
  else
  {
    if (strcmp(dot_value,".as") == 0)
      return 1;
  }
}

But I’m getting the error "C2144: syntax error : 'int' should be preceded by ';'"

And I can’t understand why, because #define doesn’t need ';' at the end.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:55:48+00:00Added an answer on June 9, 2026 at 9:55 am

    First, the code you have posted begins with a stray backtick. If that’s really in your code, you should remove it.

    Second, the compiler would be happier, and emit fewer warnings, if you ended your function with the line

    return 0; // unreachable
    

    This is good C++ style and is recommended. (In your case, the line may actually be reachable, in which case the line is not only good style but necessary for correct operation. Check this.)

    Otherwise, your code looks all right except for some small objections one could raise regarding the outdated, C-style use of #define and regarding one or two other minor points of style. Regarding the #define, it is not C++ source code as such but is a preprocessor directive. It is actually handled by a different program than the compiler, and is removed and replaced by proper C++ code before the compiler sees it. The preprocessor is not interested in semicolons. This is why the #define line does not end in a semicolon. Neither do other lines that begin # usually end in semicolons.

    As @JoachimIsaksson has noted, a needed semicolon may be missing from the end of the file general_configuration.h or the file helper_function.h. You should check the last line in each file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.