Undeclared Identifier

I am trying to get this example from my book to work:
// Passing by Value Week 5.cpp : Defines the entry point for the console application.
// A futile attempt to modify caller arguments
#include "stdafx.h"
#include <iostream>
using namespace std;
using std:: cout;
using std:: end;

int incr10(int num); // Function prototype



int _main()
{
int num = 3;
cout << endl
<< “incr10(num) = “ << incr10(num)
<< endl
<< “num = “ << num;
cout << endl;
return 0;
}

// Function to increment a variable by 10
int incr10(int num) // Using the same name might help..
{
num += 10; // Increment the caller argument – hopefully
return num; // Return the incremented value
}

The error messages are:
(17): error C2065: '“' : undeclared identifier
(19): error C2065: '“num' : undeclared identifier
(19): error C2065: '“' : undeclared identifier
(17): error C3861: '“incr10': identifier not found

Any help will be appreciated. Also anyone interested in tutoring please let me know.Not looking for someone to do the assignments, but to assist me. Thanks
<< incr10(num) = “ << incr10(num)

See that character in bold and underlined?

It should be one of these - " , which is the standard symbol that is commonly indicated by pressing SHIFT+2

Should be this, " not

It's meant to be the standard quote; what you've got is some kind of rich-text smart quote thing. Make sure to only use the standard characters in your source code.
Last edited on
You should probably replace all occurrences of “ (fancy quotes) with " (normal quotes).
Last edited on
Thank you for the info. The reason they are the fancy quotes is that I just copy and pasted into 2010 Studio. Thanks again Moschops and Zeillinger
Topic archived. No new replies allowed.