C
C#2y ago
zoon_

❔ Bug

My code isn't doing what it's supposed to do.. i want to make more than 1 user in my ATM system to each of their own balance and all. and i tried doing that with an idea i had but its not working properly. for example when i enter a password for user 2 it access it as user 1 instead of 2 code is here:https://paste.mod.gg/cjikmtzdtzxw/1
BlazeBin - cjikmtzdtzxw
A tool for sharing your source code with the world!
234 Replies
TheRanger
TheRanger2y ago
u mean it access it as user 0?
zoon_
zoon_OP2y ago
yeah instead of the user that acc has the password in this case its user 1 since the array is starting from 0
TheRanger
TheRanger2y ago
try debugging $debug
MODiX
MODiX2y ago
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
zoon_
zoon_OP2y ago
debugger shows nothing since there are no errors
TheRanger
TheRanger2y ago
thats not the point u arent suppose to look for compiler errors u are suppose to pause the program at certain lines to see the values of the variables the link pretty much explains what debugging is
zoon_
zoon_OP2y ago
i cant see anything on my screen lmao
TheRanger
TheRanger2y ago
what do u mean?
zoon_
zoon_OP2y ago
like the value of the variable userC where does it appear
TheRanger
TheRanger2y ago
the link should tell u where does it appear
codesandplays
codesandplays2y ago
What IDE are you using?
zoon_
zoon_OP2y ago
ohh wait let me try visual studio
codesandplays
codesandplays2y ago
Okay keep the breakpoint on the line next to the line that has the variable whose value you wanna see
TheRanger
TheRanger2y ago
code or community?
codesandplays
codesandplays2y ago
oh we have to ask that question too these days
TheRanger
TheRanger2y ago
anyway i found a bug
if (user[userC].PassCheck(x)) { Console.WriteLine("Password already exists!"); goto start; }
if (user[userC].PassCheck(x)) { Console.WriteLine("Password already exists!"); goto start; }
zoon_
zoon_OP2y ago
zoon_
zoon_OP2y ago
it reaches value 0 and then continues im trying to check if the pass already exists and if it doesnt then it goes back to the beginning
TheRanger
TheRanger2y ago
u are only checking the password of the current UserC user
zoon_
zoon_OP2y ago
mm so i have to check all
TheRanger
TheRanger2y ago
yes
zoon_
zoon_OP2y ago
okay but that doesnt fix the bigger problem im having rn :d thank you for pointing it out tho for some reason. userC gets to value 0 and just exits the loop it shouldnt even access that IF statement if the password doesnt match
TheRanger
TheRanger2y ago
look put a breakpoint at break
zoon_
zoon_OP2y ago
ok
TheRanger
TheRanger2y ago
i isnt assigned to userC yet when ur paused on it
zoon_
zoon_OP2y ago
oh
TheRanger
TheRanger2y ago
the program should pause and the line should glow yellow
zoon_
zoon_OP2y ago
yes it did it says i is 0 and userC is 0 and it just pauses there
TheRanger
TheRanger2y ago
which means that the passcode u entered is user 0's passcode right?
zoon_
zoon_OP2y ago
yes is there smth im supposed to do after it glows yellow to continue the code or smth
TheRanger
TheRanger2y ago
the link should tell you, its F10 F10 to go to the next line F5 to continue executing the program until the next breakpoint is hit
zoon_
zoon_OP2y ago
yeah it does access it as user 0 eventhough i want user 1
TheRanger
TheRanger2y ago
then you have to question urself why .PassCheck returned true
zoon_
zoon_OP2y ago
it should only return true if it matches the pasword variable in the ATM class i might be mistaken but.. shouldnt the variable passcode in ATM class have different values depending on which object im accessing ?
TheRanger
TheRanger2y ago
i entered passcode 1 for user 0 but when i debugged, its passcode is 3 you can see in ur debugger user 0's passcode
zoon_
zoon_OP2y ago
why is that happening
TheRanger
TheRanger2y ago
because when the program asks u to enter ur Please enter your desired passcode: for user 3, for example u are actually at user 0 if u breakpoint at this message
zoon_
zoon_OP2y ago
did i forget to update it
TheRanger
TheRanger2y ago
you should see at what user you're on
zoon_
zoon_OP2y ago
i should have incremented the userC right
TheRanger
TheRanger2y ago
yeah
zoon_
zoon_OP2y ago
i think i fixed it
if (user[userC].PassCheck(x)) { Console.WriteLine("Password already exists!"); goto start; }
else
{
user[userC++].Pass(x);
goto start;
}
if (user[userC].PassCheck(x)) { Console.WriteLine("Password already exists!"); goto start; }
else
{
user[userC++].Pass(x);
goto start;
}
i just made it that way that should fix it and it doesnt matter if its incremented the last time since ill zero it
TheRanger
TheRanger2y ago
please do pass checking method in the ATM class, you're code is really a mess
zoon_
zoon_OP2y ago
oh like make the method that checks for the password in the atm class ? but i alrdy did
TheRanger
TheRanger2y ago
i mean one that checks if pass exists in the array
zoon_
zoon_OP2y ago
zoon_
zoon_OP2y ago
ohh okay
TheRanger
TheRanger2y ago
public static bool CheckIfPassExists(ATM[] array, string pass)
{
foreach(var atm in array)
{
if (atm.PassCheck(pass))
{
return true
}
}
return false;
}
public static bool CheckIfPassExists(ATM[] array, string pass)
{
foreach(var atm in array)
{
if (atm.PassCheck(pass))
{
return true
}
}
return false;
}
see how readable it is
zoon_
zoon_OP2y ago
yeah much better thank you wait let me try
TheRanger
TheRanger2y ago
and u just replace
if (user[userC].PassCheck(x)) { Console.WriteLine("Password already exists!"); goto start; }
if (user[userC].PassCheck(x)) { Console.WriteLine("Password already exists!"); goto start; }
with a single line
if (Atm.CheckIfPassExists(user, x))
{
Console.WriteLine("Password already exists!");
}
if (Atm.CheckIfPassExists(user, x))
{
Console.WriteLine("Password already exists!");
}
very readable, right? i personally would initialize the ATM Array in the ATM class itself as a static field/property
zoon_
zoon_OP2y ago
yes idk why i never thought of that, just thought i have to initialize it in the other class im using it in can u show me an example
TheRanger
TheRanger2y ago
internal class ATM
{
static ATM[] array;
internal class ATM
{
static ATM[] array;
zoon_
zoon_OP2y ago
and then i can just call it with the object ill make inside the other class right ?
TheRanger
TheRanger2y ago
and id define a method called AddUser in the class too which would add a user to this array
zoon_
zoon_OP2y ago
okay i will try to make the code more clean
TheRanger
TheRanger2y ago
i dont know if you learned List<T> yet
zoon_
zoon_OP2y ago
no i haven't
TheRanger
TheRanger2y ago
also you dont really have to define a variable called int userC you can just ATM currentUser = null; also something doesnt make sense are u suppose to have 3 users or 3 ATMs?
zoon_
zoon_OP2y ago
well 3 users and for each user they have their own object so the balance is different and all think of it as 3 different accounts at a bank
TheRanger
TheRanger2y ago
so a single ATM?
zoon_
zoon_OP2y ago
thats what i was going for yeah it should be a single atm but different objects of that atm
TheRanger
TheRanger2y ago
well you should have a class called Bank atleast the bank is the one who has the user's accounts and their pass
zoon_
zoon_OP2y ago
and the atm holds the balance and deposit and all ?
TheRanger
TheRanger2y ago
yes
zoon_
zoon_OP2y ago
okie hold on
TheRanger
TheRanger2y ago
basically u will have a bank property/field in class atm that will point to the bank that you specify
zoon_
zoon_OP2y ago
so like that
zoon_
zoon_OP2y ago
TheRanger
TheRanger2y ago
doesnt make sense to create a new bank for each atm
zoon_
zoon_OP2y ago
yeah it should be the opposite
TheRanger
TheRanger2y ago
u want many atms for a single bank
zoon_
zoon_OP2y ago
yeah so i can keep the array of ATM inside the bank ?
TheRanger
TheRanger2y ago
no, bank should not know anything about ATMs
zoon_
zoon_OP2y ago
do you have any tips for making user accounts ? i thought of creating an array and storing their names/passwords
TheRanger
TheRanger2y ago
you can make a class called UserAccount yeah it would make sense for the Bank class to have an array of UserAccounts the Bank class should have methods like CreateAccount, GetAccount, HasAccount
zoon_
zoon_OP2y ago
ill keep the password in the ATM class then
TheRanger
TheRanger2y ago
doesnt make sense a UserAccount has the password, not the ATM
zoon_
zoon_OP2y ago
should the currentUser be an integer ?
internal class Bank
{
private static string[] passcode;
public static void PassAdd(int current, string pass)
{
passcode[current] = pass;
Console.WriteLine("Registered successfully");
}
public static bool PassCheck(int current, string pass)
{
if (pass == passcode[current]) return true;
else return false;
}
}
internal class Bank
{
private static string[] passcode;
public static void PassAdd(int current, string pass)
{
passcode[current] = pass;
Console.WriteLine("Registered successfully");
}
public static bool PassCheck(int current, string pass)
{
if (pass == passcode[current]) return true;
else return false;
}
}
ill try to access it that way
TheRanger
TheRanger2y ago
u can do that but better practice is to get the instance of the user directly
zoon_
zoon_OP2y ago
im not sure how to do that let me try by instance of the user what do u mean
TheRanger
TheRanger2y ago
UserAccount currentUser = null; passcode should be stored in UserAccount, not bank
zoon_
zoon_OP2y ago
oh so another class solely for the useracc
TheRanger
TheRanger2y ago
yes, that class will have the passcode of the user, and their balance
zoon_
zoon_OP2y ago
why did u decide to null the currentUser
TheRanger
TheRanger2y ago
because at the beginning of the program, you havent selected a user yet, right?
zoon_
zoon_OP2y ago
yes
TheRanger
TheRanger2y ago
+ you have not created any user yet thats why
zoon_
zoon_OP2y ago
im not sure how to efficiently use the userACcount thing UserAccount currentUser = null;
zoon_
zoon_OP2y ago
zoon_
zoon_OP2y ago
ass u can see the add method needs somewhat of an index to access the list of users
TheRanger
TheRanger2y ago
currentUser should be in Program.cs
zoon_
zoon_OP2y ago
ohh
TheRanger
TheRanger2y ago
or ATM Atleast you'd want the ATM to interact with the user's account
zoon_
zoon_OP2y ago
okay ill try to think of some ways
TheRanger
TheRanger2y ago
it doesnt make sense to have an array of string in UserAccount a UserAccount cannot have multiple passcodes
zoon_
zoon_OP2y ago
i get waht you mean now userAcc is like 1 acc for each user
TheRanger
TheRanger2y ago
a class is basically a group of other classes you'd want to group a user's passcode, and their balance into a single class think of how you can convert real world materials into classes like oh, an ATM is a machine, that interacts with the bank a user account has a passcode, and a balance, so i will make a user account class, with passcode and balance variables stored inside it
zoon_
zoon_OP2y ago
ill try my best to interpret real world activities into programming programming is a really great thing was that the way u practiced ?
TheRanger
TheRanger2y ago
yes, i think so
zoon_
zoon_OP2y ago
it sounds like it worked :d how do i "select" a user with CurrentUser ?
zoon_
zoon_OP2y ago
i have it in ATM how do i access it
zoon_
zoon_OP2y ago
oh i can just make it public so after that how do i make it a current user that is for example entering his username and password
zoon_
zoon_OP2y ago
is this a good idea
TheRanger
TheRanger2y ago
good practice is to make fields private, and properties public how will the ATM know which bank to interact with? ATM is basically a remote control for bank
zoon_
zoon_OP2y ago
i only made the passcode property private welll there is only 1 bank but multiple userAccounts right ?
TheRanger
TheRanger2y ago
they are called fields, not properties
zoon_
zoon_OP2y ago
then what is the property
TheRanger
TheRanger2y ago
like this $propvsfield
MODiX
MODiX2y ago
Why use properties over a public field? - Properties can individually specify access modifiers for get and set - With Visual Studio, you can type prop, press tab and it will auto complete for you - XAML requires properties for bindings - Field exposure is really only done in readonly structs - Using properties allows for future changes to the getter or setter without breaking your API/external programs (binary compatibility) Example of an auto property:
class Example
{
public string Name { get; set; }
public int Age { get; set; }
}
class Example
{
public string Name { get; set; }
public int Age { get; set; }
}
Example of a property with backing field:
class Example
{
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}

private int _age;
public int Age
{
get { return _age; }
set { _age = value; }
}
}
class Example
{
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}

private int _age;
public int Age
{
get { return _age; }
set { _age = value; }
}
}
TheRanger
TheRanger2y ago
public string Name { get; set; } is a property private string _name; is a field what the property does is it takes the stored value from a field they are actually methods under the hood
zoon_
zoon_OP2y ago
ohh i still havent studied them no wonder i got no clue what it is
TheRanger
TheRanger2y ago
yes only 1 bank, but multiple atms
zoon_
zoon_OP2y ago
yes
TheRanger
TheRanger2y ago
atm needs to connect to the bank to extract information, like the user's passcode, and their balance
zoon_
zoon_OP2y ago
yes i did that
TheRanger
TheRanger2y ago
how? show me
zoon_
zoon_OP2y ago
well i made it interact with the userAccount directly
TheRanger
TheRanger2y ago
well that works but, what if you withdraw money from the user account? you'd also need to subtract from the bank's total money
zoon_
zoon_OP2y ago
yeah
TheRanger
TheRanger2y ago
unless you don't care about how many money the bank currently has well you can get a reference of the bank from the user account anyway
zoon_
zoon_OP2y ago
hold on let me trry something
TheRanger
TheRanger2y ago
UserAccount.userName is bad
zoon_
zoon_OP2y ago
why
TheRanger
TheRanger2y ago
its not suppose to be static
zoon_
zoon_OP2y ago
right yeah i fixed it instead i made an instance in the program.cs
TheRanger
TheRanger2y ago
show screenshot
zoon_
zoon_OP2y ago
okay sorry hold on this is program.cs this is atm yk what ill just link it
zoon_
zoon_OP2y ago
BlazeBin - gxawqjcfgtwz
A tool for sharing your source code with the world!
zoon_
zoon_OP2y ago
ik the logic in the program.cs makes no sense ill edit it rn So something really weird happens The function is executed without calculating the parameter
TheRanger
TheRanger2y ago
u can ping me share ur updated code and idk what function are u talking about
zoon_
zoon_OP2y ago
Sorry my Internet is playing games with me I'll send it when I can
zoon_
zoon_OP2y ago
BlazeBin - pzoeomvsquws
A tool for sharing your source code with the world!
zoon_
zoon_OP2y ago
@TheRanger here The part where I register a new acc. The username field is bugged
TheRanger
TheRanger2y ago
hmm? what do u mean? any reason ur doing atm.currentUser = new UserAccount(); ? before u select an account from the bank or even create one? creating a new account before accessing the atm doesn't make sense if you use the debugger, you would see your values for example when you do atm.currentUser = new UserAccount(); all of the fields are by its default values for example passcode is null, username is null, balance is 0 now, when ur program calls if (atm.NameCheck(Console.ReadLine())) where the NameCheck method calls this piece of code
if (currentUser.userName == name) return true;
else return false;
if (currentUser.userName == name) return true;
else return false;
currentUser's userName is null and the program will see it like this when you reach this line
if (null == "1234") return true;
else return false;
if (null == "1234") return true;
else return false;
assuming you input 1234 after ur program asks u to Please enter your username:
zoon_
zoon_OP2y ago
Oh So basically this is like creating an account and I'm doing it before I even have to That's what's messing it up I thought ab it but didn't pay it much attention Thank you for pointing it out I'll try to create that instance when I access the account instead
TheRanger
TheRanger2y ago
no?
zoon_
zoon_OP2y ago
After I access the atm
TheRanger
TheRanger2y ago
you should only create an instance when the atm asks u to create an account
zoon_
zoon_OP2y ago
Oh So wait I must be missing something. What exactly does the line mean then
TheRanger
TheRanger2y ago
what line
zoon_
zoon_OP2y ago
Like what am I doing behind the scenes I thought I'm just creating an object from thr class UserAccount And I create it to access it later on in the code right ?
TheRanger
TheRanger2y ago
right now you created an account that has no username and password
zoon_
zoon_OP2y ago
Yes okay
TheRanger
TheRanger2y ago
do you know why there are access modifiers like public and private?
zoon_
zoon_OP2y ago
So that's what this does. It basically creates a new acc object I think it's for safety
TheRanger
TheRanger2y ago
for private, to prevent the programmer from accessing the private members outside the class
zoon_
zoon_OP2y ago
Okay yeah
TheRanger
TheRanger2y ago
so for creating an account you should force the programmer to create an account with a username and password because right now a programmer can create an account without a username and password which doesnt make sense
zoon_
zoon_OP2y ago
So it has to be declared after writing a username and password ?
TheRanger
TheRanger2y ago
this is where constructor comes you do something like new UserAccount("foo","1234");
zoon_
zoon_OP2y ago
I haven't learnt constructors yet 😕 I'm just trying to manage with what I've learnt and step by step with every new thing I learn I adjust my code
TheRanger
TheRanger2y ago
you should not allow the programmer to write new UserAccount(); if they tried to, a compiler error would appear
zoon_
zoon_OP2y ago
Well how can I avoid it. if I need to create a new instance for each acc so each username and password are different for each user That's my goal
TheRanger
TheRanger2y ago
public UserAccount(string username, string password)
{
userName = username;
passcode = password;
}
public UserAccount(string username, string password)
{
userName = username;
passcode = password;
}
you define that in the UserAccount class this is a constructor takes the arguments of username and password, and assigns their values to the following fields
zoon_
zoon_OP2y ago
So for now my problem is with creating an instance of UserAccount before the user name and password are sent ? Why ? I'm confused what you mean Also sorry i feel like I am taking too much of ur time
TheRanger
TheRanger2y ago
like, the program would give you an error before you run it
zoon_
zoon_OP2y ago
Ah
TheRanger
TheRanger2y ago
telling you something like the constructor requires 2 arguments
zoon_
zoon_OP2y ago
Okay I will continue learning and when I learn smth new ill adjust the code From what I understood the reason my code isn't working is because of the way I declared the instance before I should have
TheRanger
TheRanger2y ago
from the latest code you posted you created a new UserAccount, you never assign username and password to that account
zoon_
zoon_OP2y ago
Wait
TheRanger
TheRanger2y ago
then the atm logged into that account, which has no username and password
zoon_
zoon_OP2y ago
When I create a new user account I'm creating it with what's stored inside it ? Not create it THEN store smth inside it ?
TheRanger
TheRanger2y ago
? u created an account and you didnt store anything inside it no username, no password then the atm logged into that account, which makes no sense then your program asks to enter a username
zoon_
zoon_OP2y ago
So I store first then create an instance which will have what was stored inside it saved So the object of the class is basically taking it with what's inside it and creating for example a new slice with that information saved and not touched
TheRanger
TheRanger2y ago
then the program to check if username exists by comparing the username you entered WITH the current logged in user's username, which is null
zoon_
zoon_OP2y ago
Ah
TheRanger
TheRanger2y ago
which makes no sense at all you are not suppose to login to any username yet before the program asks u to enter the username and password
zoon_
zoon_OP2y ago
So object created with what was stored in the class then the information in the class I stored are deleted waiting for a new entry? Is what I understood Fair enough Thank you bro
TheRanger
TheRanger2y ago
no what class, the useraccount?
zoon_
zoon_OP2y ago
Yeah
TheRanger
TheRanger2y ago
what is stored in the class?
zoon_
zoon_OP2y ago
Like for example I enter username and password then create an instance of that class with what's stored
TheRanger
TheRanger2y ago
+ atm's currentUser should be private
zoon_
zoon_OP2y ago
Then the username and password in the class not the instance. Is nulled again
TheRanger
TheRanger2y ago
Then the username and password in the class that doesnt make sense why would the username and password get nulled? each instance of each account has their own username and password
zoon_
zoon_OP2y ago
Okay I got it Thank you again
TheRanger
TheRanger2y ago
new UserAccount(); basically creates an instance of that class and stores it somewhere in the memory atm.currentUser = new UserAccount(); creates an instance of that class and stores it somewhere in the memory and lets atm.currentUser point to that instance you can create many accounts, and let atm's currentUser only point to one of them
zoon_
zoon_OP2y ago
okayy i got it makes sense yeha
TheRanger
TheRanger2y ago
in other words, new here in ur case means creating a new account
zoon_
zoon_OP2y ago
even though i created an instance it still says its null
zoon_
zoon_OP2y ago
now it does this
zoon_
zoon_OP2y ago
something is wrong with the nameCheck method
TheRanger
TheRanger2y ago
atm.cs line 21 it helps if you showed ur updated code
zoon_
zoon_OP2y ago
if (currentUser.userName == name) return true; that yeah okayy
TheRanger
TheRanger2y ago
not enough context, have to see ur whole code if that is atm.cs line 21 the error here means ur trying to access a member of a variable that is not pointing to an instance in your case, currentUser isn't pointing to an instance of a UserAccount
zoon_
zoon_OP2y ago
yeah its null
TheRanger
TheRanger2y ago
what is even the point of that line?
zoon_
zoon_OP2y ago
yeah its currently pointing to nothing and im trying to figure out how to make it point to the Instance i created in Program.cs i wanted to create a method to check if that username exists in any of the instances
TheRanger
TheRanger2y ago
im trying to figure out how to make it point to the Instance i created in Program.cs but why?
zoon_
zoon_OP2y ago
i think i did that wrong
TheRanger
TheRanger2y ago
yeah, but do u know how to do that?
zoon_
zoon_OP2y ago
i thought of passing the instance of the acc i created to the method and access the username of THAT instance but that will only check 1 instance i think
TheRanger
TheRanger2y ago
yes, what if there is 100,000 accounts
zoon_
zoon_OP2y ago
i guess i need to iterate somehow
TheRanger
TheRanger2y ago
how are u gonna check every account correct
zoon_
zoon_OP2y ago
okay instead, ill create an array of instances UserAccount[] User = new UserAccount[];
TheRanger
TheRanger2y ago
correct do u know where to store that?
zoon_
zoon_OP2y ago
this is going to be in Program.cs ?
TheRanger
TheRanger2y ago
doesnt make sense choose another class
zoon_
zoon_OP2y ago
then if im basically creating user accounts i guess it should be in bank
TheRanger
TheRanger2y ago
yes
zoon_
zoon_OP2y ago
but do i create an instance of bank in program.cs ? or access it from the ATM
TheRanger
TheRanger2y ago
well if you need to initialize like 10 ATMs you need to tell them which bank it needs to access
zoon_
zoon_OP2y ago
is that a good idea
TheRanger
TheRanger2y ago
i wouldnt recommend it if it wasn't
zoon_
zoon_OP2y ago
well since i created an array now how am i gonna access each index
TheRanger
TheRanger2y ago
right now ur atm creates its own bank, so if you created 10 atm, u will have 10 banks which doesnt make sense
zoon_
zoon_OP2y ago
lmao yeah it doesnt
TheRanger
TheRanger2y ago
what did u try so far?
zoon_
zoon_OP2y ago
i had it for those
zoon_
zoon_OP2y ago
i wanted to create a CurrentUser iterator that depending on the username it chooses a number like 0 1 or 2
TheRanger
TheRanger2y ago
what does the error message say?
zoon_
zoon_OP2y ago
its there bczi removed the instance of the bank in ATM.cs
TheRanger
TheRanger2y ago
uh no? please read the error message
zoon_
zoon_OP2y ago
TheRanger
TheRanger2y ago
what you said doesnt make sense do u know what instance means?
zoon_
zoon_OP2y ago
Bank bank = new Bank(); thats an instance right ?
TheRanger
TheRanger2y ago
new Bank(); creates a new instance yes variable bank points to that instance many variables can point to the same instance
zoon_
zoon_OP2y ago
ohh okay got it
TheRanger
TheRanger2y ago
say in real life you have 3 nick names, and a real name a,b,c, and mazen when someone says a, they are refering to you, right?
zoon_
zoon_OP2y ago
yea
TheRanger
TheRanger2y ago
or when someone says b, they are refering to you, right?
zoon_
zoon_OP2y ago
yes
TheRanger
TheRanger2y ago
same thing with the variables
zoon_
zoon_OP2y ago
i see
TheRanger
TheRanger2y ago
you can have an empty field Bank bank; for now its null it doesnt refer to any bank yet
zoon_
zoon_OP2y ago
oh right yeah that works too okay i have to go sleep now i will continue this later thank you Tomorrow ill try to fix those bugs i have
TheRanger
TheRanger2y ago
ur gonna make it refer to the single instance of the bank that u created same with the other atms, they will all refer to the same bank in program.cs for example
zoon_
zoon_OP2y ago
i just need to know how to refer to one only
TheRanger
TheRanger2y ago
var mazen = new Human();
var a = mazen;
var b = a;
var c = b; // also var c = mazen works
var mazen = new Human();
var a = mazen;
var b = a;
var c = b; // also var c = mazen works
zoon_
zoon_OP2y ago
oh just like that ?
TheRanger
TheRanger2y ago
yes
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server