• Register

Recent questions tagged function

0 votes
1 answer 3 views
Problem Hey, I have a line of code which is causing an error for the name that can’t be assigned to the function call.can please help me to fix this error. Please try to answer in easy to understand manner. This will be great for me Code: invest( ... ) = subsequent_amount Error: SyntaxError: can't assign to function call How can I fix this error to make this value of the function call.
asked 6 days ago chris jordan 2.2k points
0 votes
1 answer 7 views
Problem Hey, want to ask you about my problem regarding a file passing to a function. I was trying to create a file which will ask to user for its path then passing it as an argument to a new input/ output then passing that file as a reference to update file ... ::ifstream OutputFile (FilePath);     std::ofstream InputFile (FilePath);          ModifyFile(OutputFile, InputFile);     return 0; }
asked Jan 12 chris jordan 2.2k points
0 votes
1 answer 18 views
Problem: The strftime() method returns a string representing date and time using date, time or datetime object.ou will to convert date, time and datetime objects to its equivalent string (with the help of examples).The datetime object containing current date and time is stored in now variable.
asked Jan 10 Mashhoodch 5.6k points
0 votes
1 answer 13 views
Problem: This Question / Answer (Python call constructor in a member function) says it is possible to to call the constructor from within a member function. How do I do that? Is it good a style? I tried it with the following code: class SomeClass(object): def __init__( ... = SomeClass(True) def main(): inst = SomeClass(False) inst.build_new() print(inst.field) if __name__ == '__main__': main()
asked Jan 6 Mashhoodch 5.6k points
0 votes
1 answer 17 views
Problem: Hello! I am a beginner. I have learned basic programming in C++ and I recently moved to advanced programming. While reading a book, I came across the term “procedure” that was being used as the synonym of “function”. I could not ... in that book but, it seems to me exactly like a function. Can anybody here please explain the difference between both of these?
asked Jan 5 Code Learner 5.5k points
0 votes
1 answer 2 views
Problem Hey, what is abstract factory design and we use this. Will you please help me?
asked Jan 5 chris jordan 2.2k points
0 votes
1 answer 10 views
Problem: I want to implement a kind of console (function menu_principal), where the user can go to different menus according to their choice. One of these options is to enter a directory (function dir_manager, accessed with the number 1). Once the user wants to end the execution, he must type the ... * option1 = 1; // <---- THIS IS THE ERROR return; } else if (* option1 == 9) { return; } } }
asked Jan 1 sasha 5.3k points
0 votes
1 answer 9 views
Problem: I want to write a function that receives two pointers to functions and returns a pointer to the function composicion. Is it possible to do that? This was my idea: typedef int (* integerFunction) (int); integer function composition (integer function f1, integer function f2) { return f1 (f2); }
asked Jan 1 sasha 5.3k points
0 votes
1 answer 15 views
Problem: My problem is the following: I have a class Nodo, which has as an attribute an array of pointers toto its same type (as to make a tree) and then I have a child class NodoAvlthat must inherit that attribute but the pointers must point to the same type , that is, point to NodoAvl. ... = T ()): Node <T> (data) {} int altu () {return alt;} }; Is there a way to do this? Thanks in advance.
asked Jan 1 sasha 5.3k points
0 votes
1 answer 11 views
Problem: The following C++ code uses a ifstream object to read integers from a text file (which has one number per line) until it hits EOF. Why does it read the integer on the last line twice? How to fix this? Code: #include <iostream> #include <fstream> using namespace std; int main() { ... txt has integers, one per line while (!iFile.eof()) { int x; iFile >> x; cerr << x << endl; } return 0; }
asked Dec 25, 2020 Mashhoodch 5.6k points
0 votes
1 answer 20 views
Problem: Hi there! I just took an exam of programming in which there was a multiple-choice question that said: &ldquo;When an array is passed to a function, it is interpreted as _____&rdquo;: Address of the first element of the array. The number of elements of the array. Address ... 5,4,3,2,1. I did not understand the output. Can anybody please explain it? Also, tell the answer to the above MCQ.
asked Dec 24, 2020 Code Learner 5.5k points
0 votes
1 answer 6 views
Problem Hey, I just started learning C++ and I want to learn to observe design patterns. I am just a beginner. So, please try to give an answer in an easy-to-understand manner.so that my time would be safe. This hope you will take care of requirements.it&rsquo;s not a big deal.so, please
asked Dec 24, 2020 chris jordan 2.2k points
0 votes
1 answer 15 views
Problem What is meant by the term auto in C++.
asked Dec 23, 2020 chris jordan 2.2k points
0 votes
1 answer 18 views
Problem Hey, what is dynamic_cast in C++. provide me a relevant solution that can clear everything.
asked Dec 23, 2020 chris jordan 2.2k points
0 votes
1 answer 6 views
Problem: What is a const member function in C++? What is the syntax of a const member function? How do you declare a constant in C++? What does const after a function mean?How member function can be called on a const object (or via a reference-or-pointer-to-const), and that the member function cannot modify data members (unless they're marked mutable ?
asked Dec 23, 2020 Mashhoodch 5.6k points
0 votes
1 answer 5 views
Problem: What is private member function in C++? How do you use private members in C++? What is member function with example? What is data member in C++ with example? How can i declare a function/class as friend of that particular class, and then the member will be accessible inside that function or class object without access specifier check?
asked Dec 23, 2020 Mashhoodch 5.6k points
0 votes
1 answer 12 views
Problem Hey, how can we differentiate shallow copy and deep copy of a class?
asked Dec 22, 2020 chris jordan 2.2k points
0 votes
1 answer 7 views
Program Hey, I just want to know how to pass pointers to function.
asked Dec 22, 2020 chris jordan 2.2k points
0 votes
1 answer 9 views
Problem: What is the difference between function and method in C++?
asked Dec 22, 2020 prog_learner 2.5k points
0 votes
1 answer 16 views
Problem Hey, I Am facing an error at the time of compilation. Compiler says permission denied and Id returned to 1 exit status. Someone can help me resolve this error. That will be helpful for me. Here&rsquo;s my binary search algorithm code that I was trying to compile. Algorithm: #include <stdio.h>         ...          printf("Your value is not in the array.");                          }    } }
asked Dec 21, 2020 chris jordan 2.2k points