- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 13
- Posts with Upvotes
- 10
- Upvoting Members
- 10
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re:
I chose to enter 4 months during runtime. I decided to test out the member functions/dynamic feature of linked lists, by then adding 3 months before compile time (static binding), which would be appear after the first 4 months. The program outputs: > Full list again: > Month January, had … |
|
Re:
Hi! I've encountered another problem, The code below is just the part of the code where the error occurs int FindStr(FILE *f, char *str) { int s_pos; //string position in the text int c_pos; //char position in the text char *string; char ccnt; //char count s_pos = -1; c_pos = … |
|
Re:
Making a Game for a school project and Im using a 2D array to make the gameboard. Well in the begginning of the game the user has to input what the current game board looks like. I have it so the user is entering data and the data is being … |
|
Re:
Hey guys, I have a problem. I created a quick sort program and it functions perfectly for quantity less than 100. I searched for errors and changed and now for more than 100 values, it runs perfectly and sometimes it hangs. I am unable to decipher whats the error. Did … |
|
Re:
There are n persons numbered from 0 to n - 1 standing in a circle. The person number k, counting from the person number 0, is executed. After that the person number k of the remaining persons is executed, counting from the person after the last executed one. The process … |
|
Re:
I think the code comments show what is needed. Essentially, I just need to spit out the members name and score who are below the average score in the list. [CODE] void displayLowScore(struct payload *arrayStart , //first element of array struct payload *arrayEnd ) //last element of array { int … |
|
Re:
I am not looking for an explicit answer to this question, and I have googled/searched this site for hours trying to find an example to work off of. What I can't figure out is how to write a nested "for loop" that will allow the user to input one number … |
|
Re:
How can I write a for loop that will help me run this twice so that I won't have to re-type code for other data type Student variables? Student S1, S2; for (int x = 1; x < 3; x++) { cout << "Enter First Name: " << endl; getline(cin,Firstname); … |
|
Re:
im doing a college project in c++. it is a token system of bank(line,queue..).it waits for a enter key and then it creates a token with entry time and expected leaving time,cashier to attend to and token no. whenever i compile the program it gives no error but after runing … |
|
Re:
Windows 7 Dev C++ version 4.9.9.2 Hello I am fallowing the wrath lands game creator tutorial and I am having the following problem. [CODE]Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Proj\Nimph\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\Proj\Nimph\Makefile.win" all g++.exe main.o battle.o town.o crossroads.o helper.o player.o -o "Nimph.exe" -L"C:/Dev-Cpp/lib" crossroads.o(.bss+0x0):crossroads.cpp: multiple definition of `player' … |
|
Re:
I am trying to use the playsound function i have the code [CODE] PlaySound(L"C:\Documents and Settings\Louisa\My Documents\Visual Studio 2010\Projects\Ninja_Wars\Ninja_Wars\music.wav",NULL,SND_FILENAME|SND_ASYNC | SND_LOOP); Sint32 delta;[/CODE] But when i play the game all i hear is a beeping sound- the one windows has when there is an error or something. Can anyone help … |
|
Re:
[B]I've written a code but it doesn't run! I can't find the problem and the Error is : Declaration Syntax Error will anyone help me?! :)[/B] [CODE] #include<iostream.h> void hi(void); void name(void); int main() { int m; cout<<"Enter one of numbers below:\n"<<"1.Hi\n"<<"2.Name:"; cin>>m; switch (m) { case 1: hi(); break; … |
|
Re:
The if statment I am using in my main program is not working, it should return the else value, but is returning the information in the if part of the statment and then it causes a run time error. I am not sure what is going wrong. [CODE] que1.add("Fish"); que1.add("Whale"); … |
|
Re:
this is what i'm doing.. [code=c++]cout << "Value:" << endl; cin>>it; //it is int cout<<1; for (pos = v->begin(); pos != v->end(); pos++) { // pos is an iterator and v is a vector<int> if (*pos < it) { v2->push_back(*pos); cout << *pos << endl; } } cout<<2;[/code] This is … |
|
Re:
Hi friends, I am new to c++, just find this example from the book, but when i try to run in my visual studio,its gives problem. there is no error in the codes, it compile well, and in main screen ask the user to input the selection that they want, … |
|
Re:
Hello all, I'm trying to do this homework assignment but I keep getting an error when it compiles. The problem it has is in the startlotto function but I can't find it. It says that I have 2 errors: "error C2143: syntax error : missing ')' before ';'. "error C2059: … |
|
Re:
For the following function can one of you guys take a look and see if what I have at the bottom is correct.. [CODE] void f(char ch) { if (('A' <= ch) && (ch <= 'H')) { f(ch - 1); cout << ch; } else cout << endl; } [/CODE] … |
|
Re:
Hello, I have a simple question. Look at the following code: [CODE]class ClsA { int * var1; ClsA(); ~ClsA(); } ClsA::ClsA(){ var1 = new int [10]; } ClsA::~ClsA{ delete [] var1; cout<<"Apel destructor"; } void funct(){ ClsA ** p = new ClsA * [10]; ..... delete [] p; }[/CODE] When … |
|
Re:
I am sorry to bother people with silly questions, But I have no choice. I have a statement unsigned short a=4000, current_word; current_word=a << 3; Then I have another statement unsigned long a=4000, current_word; current_word=a << 19; According to my knowledge they will contain the same value. Am I right? |
|
Re:
Hello everybody, I would link to represent a graph with incidence lists. This picture is what I've thought about: [URL="http://img697.imageshack.us/img697/2640/incidence.jpg"]http://img697.imageshack.us/img697/2640/incidence.jpg[/URL] This is what I created: [CODE] #include <cstdlib> #include <iostream> using namespace std; class Edge; class Pointer; class Node { public: Node* nNext; Pointer* incList; char First; Node(char a) : … |
|
Re:
Hi, I am making application where I need to repaint windows form where I display some variables. I used InvalidateRect(NULL,0,0); - now the form is refreshing but started to blink because I refresh whole area,and I dont need to refresh all the buttons and static text ,only area where I … |
|
Re:
It only has one player, and no it isn't that technical on the rules of soccer. If the ball gets out of bounds there is no penalty shot, it just respawns randomly on the field. My problem is in my lookatball funtion I think, but I am not sure. Sorry … |
|
Re:
this is a program to change the case of all letters input by the user to small. im getting the right output with this coding. the problem is that its giving some staircase type structure as the output as well. HOW DO I GET RID OF THIS EXTRA STUFF? [code] … |
|
Re:
hi i'm trying to write a program that compares and manipulates certain characters from a string. heres the bit i'm having trouble with. [CODE] char c; if(c <= a && c >= x)//obvious error //do something [/CODE] is there anyway i can get this to check if 'char c' lies … |
|
Re:
I wrote this code for fun. Wanted to do such a thing so that I would be able to use this in the future. I'm kinda new to this forum. I like to know what you think about the code. If can point out some mistakes or ways to improve … |
|
Re:
I am trying to develop a function in a linked list that outputs in a specific manner however I am getting compile errors. Tis is the code: listelement.h [CODE]virtual void out(ofstream& myfile) = 0;[/CODE] list.h includes listelement.h [CODE]void OutList(ofstream& myfile);[/CODE] list.cc includes list.h [CODE]void List::OutList(ofstream &myfile){ ofstream file; file.open("tris.dat"); if(myfile.is_open()){ … |
|
Re:
Is there a easier way to do multiple send keys instead of just having to C/P? [code]SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}");[/code] |
|
Re:
[CODE] #include <cstdlib> #include <iostream> #include <cmath> #define width 5 using namespace std; void SelectionSort(double array[][5], int height); int main() { int height; int i,j,lab,midterm,final,number; float avglab,avgmid,avgfinal,totallab,totalmid,totalfinal; cout<<"Number of students: "; cin>>height; cout<<"\n"; double array[height][5]; for(i=0;i<height;i++) { cout<<"Please enter student number: "; cin>>number; array[i][0]=number; } cout<<"\n"; cout<<"Please enter Lab scores.\n"; … |
|
Re:
Hi I am having issues populating a vector using "new" where nodeVec is a vector where each entry consists of another vector with 3 elements. zMap is the vector I am trying to populate with the sum of the squares of the first two elements for each entry in nodeVec. … |
|
Re:
Hey guys, I'm looking to add on to a recent program of mine that uses classes. My next step is to add in a working overloaded equality function in order to compare the gross pay of two Employees within the class. Now, I've read up on this quite a bit … |