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 7025819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:01:51+00:00 2026-05-28T00:01:51+00:00

Consider this code: #include <iostream> int main() { int iTemp = 0; iTemp +=

  • 0

Consider this code:

#include <iostream>

int main() 
{
   int iTemp = 0;

   iTemp += 1;     // Valid

   iTemp + = 1;   // This gives an error ( note the space between '+' and '=')

   return 0;
}

Should the parser not automatically have consumed this space and checked for the presence of ‘=’ as ‘+=’ is also a valid token, rather than throwing an error ?

Similarly I get an error for doing < iostream >

Can someone please explain.

  • 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-05-28T00:01:51+00:00Added an answer on May 28, 2026 at 12:01 am

    Doesn’t work.
    The first step of C compilation is tokenization – breaking the sequence of characters to separate language elements. For example:
    int x=333; becomes the list int, x, =, 333 and ;‘.
    Once this is done, the compiler can figure out which token means what and how to combine them.

    If tokenization sees the sequence +=, it generates one token. If it sees a space, it generates two: + and =.

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

Sidebar

Related Questions

Consider this code: #include <iostream> template<class C> struct time { }; int main() {
Consider this code: #include <iostream> using namespace std; int main() { bool lock =
Consider this code: int main() { int e; prn(e); return 0; } void prn(double
Consider this code: one.c: #include <stdio.h> int one() { printf(one!\n); return 1; } two.c:
consider this simple and pointless code. #include <iostream> struct A { template<int N> void
Consider this C code: #include stdio.h int main(void) { int count = 5; unsigned
Consider this code: #include <iostream> using namespace std; typedef int array[12]; array sample; array
Consider this example: #include <algorithm> #include <iostream> int main() { std::string str = abcde4fghijk4l5mnopqrs6t8uvwxyz;
Consider this code: #include <memory> #include <iostream> class A { public: A(int data) :
Consider this code: void res(int a,int n) { printf(%d %d, ,a,n); } void main(void)

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.