I am trying to enter a single string in C++ in which I give a URL citation. the entire line is as follows:

cout << 'furey, edward "sphere calculator" at https://www.calculatorsoup.com/calculators/geometry-solids/sphere.php from calculatorsoup, https://www.calculatorsoup.com - online calculators' << endl;

I am getting the error: character constant too long for its type.

I believe I am getting this code because of my single quotes instead of double quotes before and after my string. But when I replace them with double quotes, I get the "not expected" error.
Any help would be greatly appreciated.

verrandhack commented: Great job. +0

You'll want to escape those quote marks and maybe more. Read https://en.cppreference.com/w/cpp/language/escape

Example follows:

#include <iostream>
using namespace std;

int main() {
  cout << "furey, edward \"sphere calculator\" at https://www.calculatorsoup.com/calculators/geometry-solids/sphere.php from calculatorsoup, https://www.calculatorsoup.com - online calculators" << endl;
  return 0;
}
commented: Thank you much! That’s just what I needed. +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.