Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Дмитро on July 02, 2016, 06:06:46 pm

Title: Today, some of the code was not executed!
Post by: Дмитро on July 02, 2016, 06:06:46 pm
Good time of day!


Forgive me, poor English.

You know, I do not understand what is happening. I do not understand.

I appends new rows into the program. These new lines - this output to a text file.

I recompile the program. As if things right skompilyuvalosya.

But no record in the file !! I shake ,, ,, rebuyld and recompile again.

No record in the text file !! I'm deleting .exe files and .o.

Recompile. Again, I see no record in the file !!

That tion behold area program file says nothing.
It is located directly in the code, of sorts cycles. Just out of sorts cycles
and if he passed!

In the same function, all the same, exactly the same similar records in the same text
file there normally good, but only those that I wrote yesterday and earlier!
Today, this same feature all entries in the log file is compiled, but not implemented.

What it is??????? What I think ?????? What I do not understand??

I am not master of programming, I just finished school and I play most of the programs.
But on the plus I sometimes write about the fifth year. I could not so oblazhatysya. I do not see bugs in the code.
So what is it ????

Where am I still wrong ??


(http://www.imageup.ru/img88/thumb/debug22472711.jpg) (http://www.imageup.ru/img88/2472711/debug2.bmp.html)



It is this code.
Code
 int XX;
    dokument[NUMRYADOK][ NUMZNAK ][0] = Symbol;


logFile << "" << '\n';
logFile << " dokument[NUMRYADOK][ NUMZNAK ][0] " << '\n';
logFile << std::hex << (int)(dokument[NUMRYADOK][ NUMZNAK ][0]) << '\n';
logFile << dokument[NUMRYADOK][ NUMZNAK ][0] << '\n';
logFile << "" << '\n';
logFile << " Symbol:   "  ;
logFile << std::hex << (int)Symbol << '\n';
logFile << "" << '\n';

           logFile << "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR:";
//Sleep(1000);


This text file itself.
This entry therein of the same function.

  Potsaly!!!
1111111:0x3e2800

3e4340

 V tsykli 1: 0 V tsykli J: 0

3e4360

 V tsykli 1: 0 V tsykli J: 1

3e4380

 V tsykli 1: 0 V tsykli J: 2

3e43a0

 V tsykli 1: 1 V tsykli J: 0

3e43c0

 V tsykli 1: 1 V tsykli J: 1

3e43e0

 V tsykli 1: 1 V tsykli J: 2


Code
	//Sleep(1000);

//delete[] ZastarivPamjatay;
//ZastarivPamjatay=Pamjatay;    // А чі буде тепер ZastarivPamjatay вказувати саме на мічсце Pamjatay?

cout << " 1111111: " ;
logFile << "1111111:";
//Sleep(1000);
    char***dokument = new char**[NUMRYADOK+1];     cout << std::hex << (dokument) << '\n'; logFile <<  std::hex << (dokument)  << '\n';
    for (int A = 0; A <= NUMRYADOK+1; A++) dokument[A] = new char* [Pamjatay[NUMRYADOK]+1];  // new char**Znak [NUMZNAK для кожного NUMRYADOK

//Sleep(1000);
  for( int i = 0; i <= NUMRYADOK+1; ++i )
  {
        for( int J = 0; J <= Pamjatay[NUMRYADOK]+1; ++J )
   {

        dokument[ i ] [J] = new char[ 4+1 ];
//Sleep(1000);
cout << "" << '\n';
cout << std::hex << (int)(dokument[ i ] [J]) << '\n';
cout << "" << '\n';
cout << " V tsykli 1: " << i <<
" V tsykli J: " << J  <<   endl;
logFile << "" << '\n';
logFile << std::hex << (int)(dokument[ i ] [J]) << '\n';
logFile << "" << '\n';
logFile << " V tsykli 1: " << i <<
" V tsykli J: " << J  <<   endl;
   }
  }


This is the same function. Output is the same and in the same the same log file.

The code in a function that I wrote yesterday and earlier
displayed well. The code is not today is not displayed, it is not executed at all the code which created today!

(http://www.imageup.ru/img88/thumb/debug32472734.jpg) (http://www.imageup.ru/img88/2472734/debug3.bmp.html)



Code
void nakopychuvach (char *Symbol, char***Ves_masyv, int *ZastarivPamjatay, spilna_pamyat* Ps, ofstream & priymach)
{

std::fstream logFile;
logFile.open("log.txt", std::ios_base::out);

logFile << "  Potsaly!!!" << '\n';

cout << "  Persa stroka: Pryjnjaly  Ves_masyv "<< Ves_masyv <<
  endl;

int ddg;

 
int Adresa_Ves_masyva = (int)&Ves_masyv;


  cout << "  Adresa_Ves_masyva "<< Adresa_Ves_masyva <<

  cout << "  Jakir1 "<< Jakir1 <<
  endl;
static long NUMRYADOK=0;
static long NUMZNAK=0;
NUMZNAK++;
if (Symbol==(char*)ZAKINCHENNYA_RYADKA) {NUMRYADOK++; NUMZNAK=0;}

/*Для того що б не втратити знаки для кожного нового рядка. Рядки то не рівні і це у нас не квадрат. */

int *Pamjatay = new int [NUMRYADOK+1]; //Запам'ятовувач рядків
Pamjatay[NUMRYADOK] = NUMZNAK;

//Sleep(1000);
if ( ZastarivPamjatay!=NULL)
for (int i=0; i<=NUMRYADOK; i++)
{
         Pamjatay[i] = ZastarivPamjatay[i];
}

Pamjatay[NUMRYADOK] = NUMZNAK;

//Sleep(1000);

//delete[] ZastarivPamjatay;



I feel like a real idiot.
Perhaps this is a bug in the code but I do not see it.
Simple, simple output file did not happen!
Like I clubhand and brainless.
But the correct code! Log written, but only above or below this place, today I wrote it.
Title: Re: Today, some of the code was not executed!
Post by: stahta01 on July 02, 2016, 08:12:03 pm
You need to find a site that teaches programming; I suggest http://cboard.cprogramming.com/forum.php (http://cboard.cprogramming.com/forum.php)

Please re-read the rules!! http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)