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

  • SEARCH
  • Home
  • 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 7749403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:02:34+00:00 2026-06-01T11:02:34+00:00

I am a little curious why the program I wrote on Xcode with a

  • 0

I am a little curious why the program I wrote on Xcode with a mac runs fine, but when I try compiling on a windows system with visual studio,

I get following error:

c:\users\bryan\documents\visual studio
2010\projects\new\new\new.cpp(172): error C3861: ‘transform’:
identifier not found.

When I write transform anywhere in the program, in fact, it says the same message, as if transform is not a part of the std namespace. Here is my code if you would like to see for yourself:

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <cctype>
using namespace std;
string getInput ();
ifstream * openInFile ();
int getShiftValue ();
void cypherMenu ();
void menu ();
string shiftCharacters (int shiftNum, ifstream * inFile);
string getOutput ();
ofstream * openOutFile ();
void printSentence (string outData, ofstream * outFile);
void notOption (string optionString);
string capitalize (string choice);
string option ();
int main() {
ifstream * inFile;
ofstream * outFile;
string inFileName, outFileName, outData, optionString, capOptionString; 
int shiftNum = 0;
bool isOption = false; 
while (capOptionString.compare("2") != 0 || 
capOptionString.compare("QUIT") != 0) {
do {
    menu();
    optionString = option();
    capOptionString = capitalize(optionString);
    if (capOptionString.compare("1") == 0 || capOptionString.compare("CAESAR")
        == 0) {
        isOption = true;
    }
    else if (capOptionString.compare("2") == 0 || 
            capOptionString.compare("QUIT") == 0) {
            isOption = false;
    return 0;
    }
    else {
    notOption(optionString);
    }
}
while (!isOption);
cypherMenu();
inFile = openInFile(); 
shiftNum = getShiftValue();
outData = shiftCharacters(shiftNum, inFile);
inFile->clear();
inFile->close();
outFile = openOutFile();
printSentence(outData, outFile);
outFile->clear();
outFile->close();
}
return 0;
}
// Input Functions
string getInput () {
cout << "Enter an input file name: "; 
string inFileName;
getline(cin, inFileName); 
return inFileName;
}
string getOutput () {
string outFileName;
cout << "Enter an output file name: ";
getline(cin, outFileName);
cout << endl;
return outFileName;
}
ifstream * openInFile () {
ifstream * inFile; 
bool isGood = false; 
string inFileName; 
inFile = new ifstream;
do { 
    inFileName = getInput();
    inFile->open(inFileName.c_str());
    if (inFile->fail()) { 
    cout << "Couldn't open file" << endl;
    }
    else {
    isGood = true;
    }
}
while (!isGood);
return inFile;
}
ofstream * openOutFile () {
ifstream testStream; 
ofstream * outFile; 
bool isUnique = false; 
string fileName;
do { 
    fileName = getOutput();
    testStream.clear(); 
    testStream.open(fileName.c_str(), ios_base::in);
    if (testStream.good()) {
        cout << "The file already exists, please choose another" 
        << endl;
        testStream.clear();
        testStream.close();
    }
    else {
        isUnique = true;
        testStream.clear();
        testStream.close();
    }
}
while (!isUnique);
outFile = new ofstream;
outFile->open(fileName.c_str());
return outFile;
}
int getShiftValue () {
int shiftNum;
string trash;
cout << "Please enter shift value: ";
cin >> shiftNum;
getline(cin, trash); 
return shiftNum;
}
string option () {
string optionString;
getline(cin, optionString);
cout << endl;
return optionString;
}
// Data manipulation functions 
string shiftCharacters (int shiftNum, ifstream * inFile){
string inData, outData, trash, tempString; 
char outChar;
int idx = 0, idxTwo = 0, newLines = 0;
stringstream outSentence; 
do {
    while (getline(* inFile, inData, '\n')) {
        for (idx = 0; idx <= inData.length() - 1; idx++) {
            if (inData[idx] >= 'a' && inData[idx] <= 'z') {
            outChar = (((inData[idx] - 'a') + shiftNum) % 26) +
            'a';
            outSentence << outChar;
            }
            else if (inData[idx] >= 'A' && inData[idx] <= 'Z') {
                outChar = (((inData[idx] - 'A') + shiftNum) %  26) +
                'A';
                outSentence << outChar;
            }
            else {
                outChar = inData[idx];
                outSentence << outChar;
            }
        }
        outSentence << '\n';
        newLines++;
    }
}
while (!inFile->eof());
for (idxTwo = 0; idxTwo <= newLines + 1; idxTwo++) {
    getline(outSentence, tempString); 
    outData.append(tempString);
    outData += '\n';
}
return outData;
}
string capitalize (string choice) {
string outString;
outString.resize(choice.length());
transform(choice.begin(), choice.end(), outString.begin(), ::toupper);
return outString;
}
// Output funcitons
void cypherMenu () {
cout << "C A E S A R C Y P H E R P R O G R A M" << endl
<< "========================================" << endl;
return;
}
void printSentence (string outData, ofstream * outFile) {
int idx = 0;
char outChar;
stringstream outString;
outString << outData;
for (idx = 0; idx <= outData.length() - 1; idx++) { 
    outChar = outString.get();
    outFile->put(outChar); 
}
}
void menu () {
cout << "Available Options: " << endl 
    << "1. CAESAR - encrypt a file using Caesar Cypher" << endl
    << "2. QUIT - exit the program" << endl << endl
    << "Enter a keyword or option index: ";
return;
}
void notOption (string optionString) {
cout << optionString << " is an unrecognized option, try again" << endl 
<< endl;
return;
}

The problem is the transform under the capitalize funciton. It doesn’t seem to know transform at all, I even tried to write std:: before it, but it said that there is no member called transform. Is there a problem with my compiler, or is transform even used anymore since i downloaded the new studio, or maybe it is just bad practice ?

  • 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-01T11:02:36+00:00Added an answer on June 1, 2026 at 11:02 am

    As you would discover from reading documentation (e.g. http://en.cppreference.com/w/cpp/algorithm/transform), std::transform is defined in the standard header <algorithm>, which you aren’t including.

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

Sidebar

Related Questions

Use Selenium a lot, but wondering the folowing question Just a little bit curious,
This might sound a little stupid but I am still curious about what the
I came across something really weird when I wrote a little lotto program in
I am a little curious about the last lines in the two examples presented
I am new to Objective-C and I am a little curious about how I
A little backstory, currently I'm working on implementing a triangle rendering system in Expression2
I am a little curious, I have a view controller class and an NIB/XIB
Just a little bit curious, why PuTTY use its own version of private key
I have a curious little problem. I have a service that needs to create
I am curious. What is the meaning of a little envelope next to a

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.