- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 3
- Upvoting Members
- 4
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re:
Hi I am developing a program that uses Breadth First Search to map a grid(2d array) out. Breadth First Search involves storing nodes in a stack and then exploring these nodes based on Breadth or level. I know how to create a vector array which I shall use as a … |
|
Re:
Doing this project 1 step @ a time but the multiple files are starting to get confusing. Lemme start by telling you all what I need to do, then show you what I've done, and then maybe you can tell me if I'm on track with this or if I … |
|
Re:
Hi. Could you please guide me in performing operator overloading of Unary operator? Just explain the method with an example. Please add the explanation. |
|
Re:
Hello folks, I have this header file: [code=c]class Agent { private: struct AgentStruct { std::string agentName; double pID; double mID; AgentStruct *nextAgent; } *AgentP; public: Agent(std::string); void SetNextAgent(AgentStruct*); Agent* GetNextAgent(); void SendMessage(); void ReceiveMessage(); };[/code] and I have the implementation here: [code=c]/* * The constructor we are required to implement. … |
|
Re:
I have viewed some source that contained an identifier with a scope operator preceding it. Ex: [code=c++] ::var[/code] What does that mean/do? |
|
Re:
Seeing we can do it with structs, why do we need classes? See the code and quote from [URL="http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr054.htm"]Link[/URL] [QUOTE="IBM Developer"]The C++ class is an extension of the C language structure. Because the only difference between a structure and a class is that structure members have public access by default … |
|
Re:
[code] #include <iostream> #include <cstring> void rev(const char* str) { char* p = new char[strlen(str) + 1]; for(int i = 0; str[i] != '\0'; i++) { p[i] = str[strlen(str) - i]; } p[strlen(p) + 1] = '\0'; std::cout << p; } int main() { const char* s = "vBx"; rev(s); … |
|
Re:
hello i am having a little problem, I cant convert a double to one decimal place: here is my code [code=c]for(int i=0; i<marklist.size();i++) { double result=floor((marklist.at(i) /maxmark)); cout<< result<<endl; } [/code] I want result to be one decimal place |
|
Re:
Ive written this program yet have stumbled upon a problem. in this program, im supposed to make a linked list of students. i must then implement some basic functions. one is to add a student (which i believe is working properly) and another is to getStudent. i believe the code … |
|
Re:
I wrote a little test program to try to figure out some problems I am having in another program I'm working on. Code: [CODE]# include <iostream> # include <string> using namespace std; void ahoy(string nameEntered) { cout << "Ahoy, " << nameEntered << "!" << endl; } int main() { … |
|
Re:
I wonder whether there is a faster way (faster then the obvious one a=a*a) to square the content of a vector of floats. I remember that bit shifting could be used somehow, but I'm not sure whether this works for floats. Any suggestions on how to achieve this are welcome … |
|
Re:
My templated function look as follows: [code] template <typename MatTypeOne, typename MatTypeTwo> void funct(MatTypeOne& m1, MatTypeTwo& m2) { //here I would need to check whether m1 and m2 are of the same "type", //meaning that MatTypeOne is the same as MatTypeTwo } [/code] What is the way to check whether … |
|
Re:
It's a program that works sort of like a lexical analyzer, but it's just supposed to pull any given data from a .txt file and display it. Nothing else. I'm not satisfied with the array I have so far. /**************************************************************** Array holding all keywords for checking. *****************************************************************/ char *keywords[]={"procedure","is","begin","end","var","cin","cout","if", "then","else","and","or","not","loop","exit","when", … |
|
Re:
[CODE] #include <iostream> using namespace std; int main() { char a = 0, b = 1, ch1, ch2, ch3, ch4, chsum; float num1, num2, num3, sum, avg; cout<<"Enter Character 'a' or 'b': "; //asking user to enter character a or b cin>>ch1; if (ch1 == a) { cout<<"Enter three floating-point … |
|
Re:
Hi guys, what is the deference between ASSERT macro and Exception handling in cpp |