Initially i wrote basic and now C++ but i dont know how to label my scripts after i write them( in C++ language!!!)
Can anyone help?????????
Initially i wrote basic and now C++ but i dont know how to label my scripts after i write them( in C++ language!!!)
Can anyone help?????????
How to label your programs? Can you be more specific? I can think of several things that could be called labeling.
Kampai!
You'll have to excuse my ignorance here but I have no idea what in the hell you are asking.how to label my scripts after i write them
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
Is he possibly talking about
that? Gotos are pretty common in Basic.Code::label blah; goto label;
Huuuuuhhhhh!!!
i.e.
there are two different parts in the whole script and the second part works with the result of the first part. At this point, how aM i gonna label the first part 2 work with it, in the second part of the script!!!
IS THİS CLEAR ENOUGH!!!
There is no need to be rude here. We are trying to help you but since you obviously don't know enough about the language in question to ask a COHERENT question do not take it out on the people trying to provide advice. Everyone has been nice here so far.IS THİS CLEAR ENOUGH!!!
What you are looking for is how to use functions. Look at this tutorial . It will show you what you want to know.
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
Yum, candy!
Oh, and if they did in fact mean to use a label, then your example is wrong:
Quzah.Code:goto label; for( ;; ); label: cout << "Now we're down here!";
Hope is the first step on the road to disappointment.
thnkz alot but am i gonna write hte name of the label between the semicolons
for( ; ???here??? ; );
Hayda!!!Whats gonna happen tomorrow
I think I see what you are trying to do but it is a little hard without any code.
Code:#include <iostream> using std::cout; using std::cin; using std::endl; int getInfo(void); //function declaration void displayHello(void); //function declaration int main() { displayHello(); //call our first function cin.get(); //keep window open return 0; } int getInfo(void) { int numTimes; cout << "How many times? "; cin >> numTimes; return numTimes; } void displayHello(void) { int maxTime; maxTime = getInfo(); for(int i = 0; i < maxTime; i++) { cout << "Hello" << endl; } }
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
yep!!!!!
this is what i am looking 4 !!!
Hayda!!!Whats gonna happen tomorrow
cant u write only
Dont misunderstand "andyhunter" i dnt wanna sound mean its just a question!!!Code:using namespace std; for not to use all using std::cout; using std::cin; using std::endl;
Last edited by himanch; 02-06-2005 at 03:30 AM.
Hayda!!!Whats gonna happen tomorrow
There are many ways to resolve a namespace in C++. This is the faq on namespaces .
As you can see a namespace is essentially a user defined scope and as such in order to access anything within that namespace you need to bring that scope into focus. One of the ways to do that with the std namespace is to have:
At the begginning of your file after the includes to bring the std namespace into global scope. Another option is to just bring the objects you will be using into scope, such as say you only wanted to deal with cin, cout and endl. You would do that by placing:Code:using namespace std;
Additionally you can use the above to methods inside of a function in order to just bring the namespace into scope for the function and not the whole program.Code:using std::cin; using std::cout; using std::endl;
And finally if you wanted to just use the objects without bringing the namespace into a larger scope you could just resolve the namespace as you went in your program:
Basically it is a style point however the whole concept of having namespaces is to prevent name clashing. Thus to just always bring the entire namespace into global scope you are defeating the whole purpose for having them. Not that this is wrong, you should just understand what you are doing.Code:#include<iostream> int main() { std::cout<<"This resolves the namespace for this object"; std::cin.get(); return 0; }
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
yea!!i see!!!
Hayda!!!Whats gonna happen tomorrow