Was bedeutet "Fehler C2065: 'J': Nicht deklarierter Kennung"?
Posted: 28 Feb 2025, 01:49
Ich habe alle anderen Kompilierungsfehler behoben, aber ich erhalte diesen Fehler immer wieder, es gibt fünf. < /p>
Code: Select all
1>\takehome\main.cpp(39) : error C2065: 'j' : undeclared identifier
1>\takehome\main.cpp(44) : error C2065: 'j' : undeclared identifier
\takehome\main.cpp(45) : error C2065: 'j' : undeclared identifier
\takehome\main.cpp(76) : error C2065: 'j' : undeclared identifier
\takehome\main.cpp(80) : error C2065: 'j' : undeclared identifier
< /code>
Ich habe versucht, alles damit zu tun, aber ich mache wahrscheinlich etwas falsch. Ich könnte Hilfe gebrauchen, wenn es Ihnen nichts ausmacht :). Übrigens, falls sich jemand wundern und Simpletron machte. < /P>
#include
using namespace std;
int main()
{
int memory[100]; //Making it 100, since simpletron contains a 100 word mem.
int operation; //taking the rest of these variables straight out of the book seeing as how they were italisized.
int operand;
int accum = 0; // the special register is starting at 0
int position = 0; //making the starting position to be 0.
for ( int j = 0; j < 100; j++ ) //Simply stating that for int j is = to 0, j must be less than 100 because that is the memory limit, and for every pass-through, increment j.
memory[j] = 0;
// This is for part a, it will take in positive variables in a sent-controlled loop and compute + print their sum. These are random variables.
memory [0] = 2942;
memory [1] = 2342;
memory [2] = 3523;
memory [3] = 2031;
memory [4] = 5000;
memory [5] = 8080;
memory [6] = 3425;
j = 0; //Makes the variable j start at 0.
while ( true )
{
memory[ j ]%100 = operand; // Finds the op codes from the limit on the memory (100)
memory[ j ]%100 = operation;
//using a switch loop to set up the loops for the cases
switch ( operation ){
case 1: //reads a variable into a word from loc.
cout memory[ operand ]; break;
case 2: // takes a word from location
cout