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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:24:20+00:00 2026-06-11T18:24:20+00:00

This is my first thred here! This code is for a glossary test from

  • 0

This is my first thred here!

This code is for a glossary test from swedish to english.

I have problem with (*it).engelska)! And why cant i use (*it).engelska in this code?

Many Thanks in advance!!

void prov(list<Glosor> lista)
{
        string testet;
        int santal = 0;
        int rsvar = 0;
        list<Glosor>::iterator it;
        for(it = lista.begin(); it != lista.end(); it++){
            cout << (*it).svenska << " betyder på engelska: "; // *it writes the swedish word for translate.
            getline(cin, testet); //Here you write the english word and "if" function test if it's correct.
            if(testet == (*it).engelska){
                cout << "Ratt svar!\n";
                rsvar++;
                }
            else{
            cout << "Tyvärr fel svar rätt svar är: "<< (*it).engelska) << endl; // Here i use "it" to write the correct answare if you guess wrong. But it keep telling me "error: expected ';' before ')' token"
            }
            santal++;
        }
        cout << "Du hade " << rsvar << " rätt svar av " << santal << " möjliga" << endl;
}
  • 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-11T18:24:21+00:00Added an answer on June 11, 2026 at 6:24 pm

    There is a closing parenthesis in line 15 after engelska that doesn’t have a matching opening parenthesis:

    cout << "Tyvärr fel svar rätt svar är: "<< (*it).engelska) << endl;
    //                           here------------------------^
    

    Also in the FOR loop @ line 7, use ++it instead of it++. The former doesn’t create a copy of the iterator, meaning it performs faster.

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

Sidebar

Related Questions

Code first: '''this is main structure of my program''' from twisted.web import http from
In the code below I have a StreamReader reading from a network stream. This
i have two arrays like this first array Array ( [0228] => Array (
Using Dozer to map two objects, I have: /** /* This first class uses
In this code, I have an Entity Framework 4 model with a single Thing
Here is my current code, http://jsfiddle.net/HRZ3D/2/ with it I have been unable to do
This is my first post here - so be gentle :-) I want to
This is the first question I have found myself not being able to get
Ok guys, this is my first thread, and I have searched online but with
I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It's

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.