Hi could anyone please help me figure out whats going on in highlighted red parts ?

// a code to produce matrix style affect
#include "stdafx.h"
#include<iostream>
using namespace std;
int modulus(int Number, int number);
char getchar(int lowerlimit, char a, int upperlimit);
int modulus(int Number, int number)
{
int q=Number/number;
return Number-(q*number);
}
char getchar(int lowerlimit, char a, int upperlimit)
{
return (a+modulus(lowerlimit,upperlimit));
}
int _tmain(int argc, _TCHAR* argv[])
{
char arr[80];
int j=7;
int k=2;
int l=5;
int m=1;
while(true)
{
int i=0;
while(i<40)
{
if(arr[i]!=' ')
{
arr[i]=getchar(j+i*i,33,30);
}
cout<<getchar(j+i*i,33,30);
cout<<getchar(7+3*3,33,30); // just to check i added this statement and ran the
program without including the statement just above it and figured out modulus function doesn't seem to work for some reason even though it should, what it does is simply add 7+9+33 and prints out the character representing that value which is (, even though what it should have done is that it should have applied modulus function to evaluate ((7+9)%30) and then should have added it to 33 as per stated in the function and then should have printed out the character represented by that value, atleast thats what i think.
i++;
}
j=(j+31);
k=(k+17);
l=(l+47);
m=(m+67);
arr[modulus(j,80)]=' '; // this is supposed to start a new streak how?when it doesnt evaluate to zero?
arr[modulus(k,80)]=''; // // this is supposed to end a streak how?
arr[modulus(l,80)]=' '; // and this is supposed to start a new streak? how?
arr[modulus(m,80)]='''; // // this is supposed to end a streak how?
//how can they end or begin a streak when they are not even printed out in the code?
i=0
while(i<3000000)
{
getchar(1,1,1);
i++;
}
}
return 0;
}

First of all, why make a modulus function. There is a pretty little operator for that in c++ (%). Also I would suggest avoiding infinite loops and relying on the system to stop your program. Instead use a boolean to wait for... what? I have no Idea what the goal is, the program does not make much sense (the variable names are pretty bad). For the matrix letter effect you would need some ability to seek in the console. Then you can do something like this:

Hi I was actually following a video tutorial, and the code was more or less a copy of that code in the video that was being explained, and I don't go to school to learn programming. I just find it very interesting, so I decided to learn it through watching video tutorial, and I am really thankful to you that you took time out to help me find answers to some of the questions Labdabeta. Can I ask you another favor please, can you just have a look at the youtube video link posted below, its less than five mins, so that I can refer to the part of the code I didn't understand please?

The guy explaining the program said that caRow[Modulus(j,80)]='-' and caRow[Modulus(l,80)]='-' are used to start the character streaks whereas caRow[Modulus(k,80)]=' ' and caRow[Modulus(m,80)]=' ' are used to end the character streaks what does that mean? Thats the only part of the program I don't understand, can anyone help me understand it please? thanks

The if check if(caRow[i]!=' ') is used to not replace a column of spaces. When not a space we replace the old character with a new random character that will be printed out. After the loop of 80 we update the values in the caRow in four positions. I think it is four different and the reason is because we are adding a prime number to all of the other the other prime numbers, except m which is 1. We replace the values in the caRow with new values that start and stop a streak of characters. The space ' ' stop the printing of a column of characters because the if check on ' ' does that. The '-' character could be any character to start a new column of random character. So, the if caRow[i]!= ' ' is what is used to not replace a column of space and the bottom randomly starts and stops columns of space.

Could you please elaborate this by giving an example, because I still don't understand what's happening there in the last few lines. And also can I ask a few questions as to what you explained up there please? Firstly I do agree that in the following lines characters ' ' and '-' are being stored, but how can they start or end the streak when they are not actually outputed in the code? Secondly how can two characters/values start a code and two characters/values end the code considering that program begins at one point and ends at just one point too? Thirdly, what difference does it make whether the values being added to j, k, l, m are prime numbers or j,k,l,m all themselves are prime numbers? And lastly how can there be a column of spaces as the value of i is incremented several times in the loop, even though I do agree, that at some points spaces would be printed out due to if statement or otherwise, but I still don't understand how there would an entire column of spaces? Please illustrate with an example if you could? I would be really grateful to you Thanks

how can they start or end the streak when they are not actually outputed in the code?

The ' ' and '-' are output. The space is what is giving the breaks in characters. The value of '-' is 45 decimal and that is allow in your set of [33-63].

How start and stop

It is the if(caRow[i]!=' ') . If the character is a space then don't change it. It is not until the lower part of the code runs after the while(i<80) runs that the value of a element that had a space in it could change. Using the

an element is change and if it happens to hit some where there was a space with the '-' assignment that column would now start to print out character values. If it hit an element in the array that was a character and now is a ' ' then the print in that column would now stop.

Thirdly

It is about not setting the same index in the caRow array twice and the incrementing with primes and mod 80 do that. Run the code below to see that you don't get the same element in the array set twice in one loop and that it just loops back to the starting conditions.

in response to how start and end, Now I do understand that a column of space would be printed when i<80 ends and comes out of the loop and reaches caRow[Modulus(k,80)] = ' '; as it would evaluate to zero, but what are others j,l,m doing? And also k wont always be zero, eventually the value would become greater than 80 and so caRow[Modulus(k,80)] = ' '; wont evaluate to zero then, so why are there j,k,l,m there then, and how they start and end the streak is still a big question, and I am sorry, I know I am bothering you a lot with all these questions, cause maybe I am not a very intelligent person, but I just don't give up, once again thanks for walking me through this, and helping me out, and if possible, please help me understand it further thanks

what are others j,l,m doing? How they start and end the streak is still a big question?

To see what is going on, start with a know initial condition, all of the elements in caRow[0..79] = ' ' (space).
Using the code below this is what you get (I added a newline so just make you terminal wider than 80 to see it better)

You can see that the first row is all spaces. That is because the if(caRow[i]!=' ') is false for all characters and none of the elements in caRow get replaced with GetChar. The next thing that happens is the chunk of code with the j,k,l,m runs to "start & stop" streaks. The added of prime numbers to the values of j,k,l,m are to get to a new "random" element in caRow. But we need to insure that we don't index outside the range of caRow (80 character in size) and that is where the Modulus functions comes in. The Modulus(x,80) insures that what ever number x is Modulus will return a number from 0 to 79. So the j,k,l,m are incremented to get to an new element (printing column) in caRow and we set two values to ' ' (stop a streak variables k & m) and two values to '-' (start a streak variables j & l). This can be seen in the second row of the output above. Only two columns now start printing "random" values. Theses are the elements (columns) that j & l started. The rest are all still spaces and don't get replaced by GetChar because again spaces don't pass the if(caRow[i]!=' ') check. Now comes the third row and two more columns are set to stop and two set to start. Four columns are now printing, that's two from the last time and two new ones that were just started by j, l. Columns/streaks are being started and stopped at every iteration but we only see the starts because we started with all colums/streaks stopped to help understand what is happening. It is not until row 12 column 47 that we see a column/streak that was started on row 10 column 47 now stop because one of the variable k or m has set that element/column in caRow to be a ' '. Which now disables the printing of that column/streak.
In the end it's all about the if(caRow[i]!=' ') which controls starts and holds stops, and the j,k,l,m are just used to find a new "random" element/column/streak to set it's value to ' ' to stop if it was running and '-' to start or continue if it was running.