How to use a header file [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am switching from PHP to C++ and I have this questions.
I have
main.cpp,true.cpp,false.cpp and header.h.
The header.h has a function "Function_go_to_requested_page.cpp()"
main.cpp looks like this
#include header.h
bool x;
cin>>x;
Function_go_to_requested_page(x) // It should take to page true.cpp if x=1 else to false.cpp
I don`t know how to define this function in header file,as I will be calling this function in both in true.cpp and false.cpp .
Thanks for your time.

how to link header files in c++
This might shed some light on how to do it. Header files essentially define what's going to be in a .cpp file. I would get a book this is pretty basic stuff.

Related

Storing Objective-C class instance in C++ class [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is there a way to store an Objective-C class instance inside of a C++ class as a member?
You need to make a .mm file, and then you can use the features outlined here. See also a reference to Apple's old documentation on the hybrid language.

Error too few arguments in function call [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Hey im getting an error too few arguments in function call for both my calculateSrabbleScore codes at the brackets, and im unsure why. I've added my calculateScrabbleScore(); to main post.
The method calculateScrabbleScore is declared to take some arguments and you did not provide any just like the error message suggests. Have a look at the declaration and you should be able to figure this problem out.
EDIT: after you have posted the function definition I can tell that you should pass a string as argument to calculateScrabbleScore.

How to create new binary file in cpp [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am new in c++. I tried to create the binary file in c++. But not able to create it.Below is my source code.
void main()
{
ofstream myfile;
myfile.open("D:\get\data.bin",ios::binary);
if (myfile.is_open())
cout<<"hi"<<endl;
else
cout<<"bye"<<endl;
}
I always get bye output only.
My required target is to create a binary file in D directory with the data as a file name.I am using VS2010 and os is win 7.
for providing the help
You have to double the backslashes :
"D:\\get\\data.bin"
Have a look at escaped characters.

Should i use inline function my program? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a 2500 line and 76.8 kb c++ console program. I learned inline function but heard about inline function makes a trouble in huge programs. Is it true? This program is huge or not. It can be a trouble in the future. What should i do or what is your suggestion for me.
Note:Program include lots of functions.
Thanks!
Is it true?
You can check out the advantage and disadvantages of Inline Functions and justify it

How to read files from a torrent file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to extract information about torrent file like: files names inside it, their sizes ..., is there a C++ library for Linux that help me achieve this easily? or what is the structure of a torrent file and how do I find these information?
You can use the libtorrent library—a feature complete C++ BitTorrent implementation focusing on efficiency and scalability.
If you want to write your own library, there is the official BitTorrent Protocol Specification but it is very poorly written and lacks a lot of details. There is also a much better specification available.