Anonymous
Anyone to recommend for me agood app for *xcode*
Dima
Dima
ios?
Anonymous
ios?
Definitely @Neko_cpp
Gimmy
Dima
Gimmy
Not have advanced, I try since Morning
Anonymous
Anonymous
Xcode is an application
🆂🄾🅼
Anonymous
Anonymous
There some resources on there ,
I_Interface
/warn Read the rules: no screen photo.
Dima
Lol
Aftab Alam آفتاب آلم
No about unused message
Aftab Alam آفتاب آلم
Plz
Aftab Alam آفتاب آلم
U can study material share on the group
Aftab Alam آفتاب آلم
Understand All member
Anonymous
Okay
Anonymous
Artöm
Artöm
Not exactly oop, but useful
Anonymous
so lets say i call a function that calls a function which also calls a function
Anonymous
i actually havent formulated the words to the question i want to ask lol
Anonymous
but basically i have a three functions, lets say function A,B, and C
Anonymous
function A is called in main and takes function B as a parameter , function B returns a structure , which Function A makes use of , but in order to create this structure, its needs to receive some data from function C, function C itself is passed as a function pointer to function B, and its called in function B, and its return value is stored in a local variable to function B
Anonymous
so thats the scenario
Anonymous
so lets say you can it like this functionA(FunctionB);
Anonymous
if i am inputting data that is being asked in function B , at that point , function A is still live and active right?
Artöm
It would be helpful to provide some code
Anonymous
It would be helpful to provide some code
i want to post but alot of times people get distracted with all the problems and how ugly the code i write is , and dont actually answer my specific question lol
Artöm
I guess answer is yes, active
Artöm
If you call a function from abother function, second needs to be finished for first to be finished. Staments are executed one after another
Artöm
It wont be true for threads or async or stuff like that
#super
Hello
Artöm
Anonymous
so lets say there is function A,B,C and a another function X, that may be used in function B only under certain conditions, if i type in the wrong data type( in testing phase ) in function C it does some really weird behavior by calling function X that was never called in that function C , so i am assuming since that function C was called by function B and that other function B does also call the function X that is called when the weird behavior happens
Anonymous
@das_3sz3tt
Anonymous
confused myself just typing that lol
Anonymous
Anonymous
this one document of an larger overall project i am working on
Anonymous
i should also mention i used typedef function pointers to pass as parameters in the functions in questions
Anonymous
int main(int argc, char const *argv[]){
create_Array(choose_Array_Member_Amount);
return 0;
}
Anonymous
thats the main document
Anonymous
so create array function calls choose array member amount function , which calls the initial Questions function
Anonymous
each function collecting some data from user and passing it the next
Anonymous
the “function X” in this case would be not_an_option or not_an_number functions . these functions are called as a default option for a switch case if the user enters an input that is not one of the cases
Anonymous
they basically just display an error message that is times and ends and goes back to the question they made the wrong input to
Anonymous
i can also send the entire program if you need to compile it to get a better picture
Anonymous
so i think i understand better what question i trying to ask , i trying to understand the behavior , like why does it a function that is lexically within the “parent” function if you havent even completed steps in the “child” function that iis currently taking user input
Artöm
Artöm
Anonymous
Anonymous
create_Array -> choose_Array_Member_Amount -> Initial_Questions
Anonymous
that is the follow of how they are called
Anonymous
each function calls the next function in the very beginning of the function
Anonymous
so the user first sees the questions of the last function , Initial question first , since choose array member amount is dependent on what is returned by initial question , and the create array function is dependent on what is returned from choose_Array_Member_Amount
Anonymous
so i see the intial questions first, asks you if you want to make a string or int array, lets say i choose int , it then returns that data to the next function
Anonymous
if i enter a wrong input it uses the default case, which calls the “function X” which in this case is the not an option () funciton which just displays a timed error message and clears the screen , then it makes use of recursion all calls itself again , to re ask the question
Anonymous
up to this point it works fine
Anonymous
its when it collects that data and passes it to the next function where the program gets weird
Anonymous
choose_Array_Member_Amount function , which is what called the intial question function in the first place now has the data it needed from the initial question function and stores it in a variable called Choice
Anonymous
choice is passed it a switch statement
Artöm
God I lost it
Anonymous
because choice is an enumeration , a default case is not needed
Anonymous
God I lost it
ArrayData choose_Array_Member_Amount(InitialQuestionP Choose){
int ArrayMemberTotal;
StringorInt choice = Choose();
ArrayData Array_Data;
Array_Data.chooseStringorInt = choice;
clearScreen();
switch(choice){
case INTEGAR:
puts("How many members do you need in your Integer Array?\n");
break;
case aSTRING:
puts("How many members do you need in your String Array?\n");
break;
}
if(scanf(" %d", &ArrayMemberTotal)){
Array_Data.ArrayMemberTotal = ArrayMemberTotal;
return Array_Data;
}
else if(scanf(" %d", &ArrayMemberTotal) != 1){
not_An_Number();
switch(choice){
case INTEGAR:
puts("How many members do you need in your Integer Array?\n");
break;
case aSTRING:
puts("How many members do you need in your String Array?\n");
break;
}
scanf(" %d", &ArrayMemberTotal);
}
}
Anonymous
this is the function where the issues happens
Anonymous
if the user types in the create data type it works fine
Anonymous
choice is an enumeration called stringorInt that has two symbols, INTEGAR, or aSTRING, which we know at this point
Anonymous
depending on which case it will ask the user one of two question
Anonymous
but the same premise , how many members do you want in your array
Anonymous
if i input an int it works fine,
Anonymous
but if type in lets say a letter , its called the not_an_option() function which is not even lexically even in that function
Anonymous
that function is only called in the initial question function
Anonymous
You write so much
Anonymous
Anonymous
do you understand ?
Artöm
Did you check all scanf calls?