Hello,
I have the following code: -
#include <list>
-
#include <iostream>
-
using namespace std;
-
-
template <class V, class AI, class I, class S>
-
AssocArray<V, AI, I, S>& AssocArray<V, AI, I, S>::operator = (const AssocArray<V, AI, I, S>& ass2)
-
{
-
(if ass2 == this)
-
return *this;
-
-
-
internal_array = ass2.internal_array;
-
-
return *this;
-
-
}
-
And the compiler gives me the following error:
expected primary-expression before "if"
expected `)' before "if"
I would appreciate any insights.
3 13352
Hello,
I have the following code:
#include <list>
#include <iostream>
using namespace std;
template <class V, class AI, class I, class S>
AssocArray<V, AI, I, S>& AssocArray<V, AI, I, S>::operator = (const AssocArray<V, AI, I, S>& ass2)
{
(if ass2 == this)
return *this;
internal_array = ass2.internal_array;
return *this;
}
And the compiler gives me the following error:
expected primary-expression before "if"
expected `)' before "if"
I would appreciate any insights.
-
if (ass2 == this)
-
return *this;
-
The brackets need to be around the expression not the entire statement
ok, this solves my problem. thanks.
ok, this solves my problem. thanks.
Glad I could help. G'luck with the program.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: andy.herrera |
last post by:
I'm getting this Error Message. Expected ';'
Please Select One:
<form name="form1"> <<------------ Error is here.
<select name="selectTrans" onChange="If (this.value == 'checkout')...
|
by: Jon |
last post by:
I'm learning about datatables. When using the example provided by MS in the
..NET Framework Class Library for DATATABLE (see below) I get an error on line
3 that says "Type expected". Is something...
|
by: Warrax |
last post by:
I am currently doing online tutorials for C++, and am pretty much stuck in a rut about this problem. It is saying that there's an expected unqualifed-id before '{' token (I will post the code in just...
|
by: JOJO123 |
last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE.
I see u guys all say, this is a...
|
by: Lawrence Spector |
last post by:
I ran into a problem using g++. Visual Studio 2005 never complained
about this, but with g++ I ran into this error. I can't figure out if
I've done something wrong or if this is a compiler bug. ...
|
by: amitmool |
last post by:
hi, i have used the queue library file and try to use the template as
template <class QueueItem>
queue <QueueItem>::~queue() // line 25
{
}
template <class QueueItem>
void...
|
by: Hunternora |
last post by:
I'm just trying to count letters, by type etc. What am I doing wrong here?
import javax.swing.JOptionPane;
public class Asg3
{
public static void main(String args)
{
int aCount=0,...
|
by: preeya |
last post by:
Hi,
I have written the following program:
-------------------------------------------------------------------------------------------------------------
1 #include <stdio.h>
2 #include...
|
by: erictheone |
last post by:
Ok so what I'm trying to do is create a trans location cipher. For those among us that don't know alot about cryptography it is a method for jumbling up letters to disguise linguistic...
|
by: rameshjumgam |
last post by:
i am having in my code like
std::list<T*>::const_iterator iter=lst.begin();
and i am getting error
error: expected `;' before âiterâ
/root/INCLUDE/cw/gdlist.h:140: error: âiterâ was...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |