49,761 Topics

Member Avatar for
Member Avatar for SacredFootball

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 …

Member Avatar for SacredFootball
0
155
Member Avatar for Jutch

I have this assignment for school due tonight but I can't figure out the two errors causing problems for me. I've asked my class, I've asked twice on yahoo answers and I still don't understand what to change. If someone can please show me the exact changes that need to …

Member Avatar for Jutch
0
201
Member Avatar for eduard77

I have a vector defined like this: [CODE] #include<iostream> #include<vector> using namespace std; typedef vector<int> VECTORINT; int main() { VECTORINT Vectorul; int x; int num; int y; cin>>num; //the number of numbers that must be entered for(int i = 0; i<num; i++){cin>>x; Vectorul.push_back(x); for(int i=0; i<Vectorul.size(); i++) cout<<Vectorul[i]<<endl; } system("pause"); …

Member Avatar for eduard77
0
112
Member Avatar for rcmango

Hi, well I have written something that compiles and runs fine with a different compiler, but when trying to use a g++ compiler, I get errors when compiling in a unix environment. Here is the command line I have used: [CODE]g++ Agent.h Agent.cpp Driver.C g++: Compilation of header file requested. …

Member Avatar for Akill10
0
116
Member Avatar for HeartBalloon

Hi, I have to write a code which should allow to append and item to a list. That is FIFO Logic, First In First Out, but I cannot think of anything of that kind actually. I mean, I should run the list until the last pointer, and then make it …

Member Avatar for HeartBalloon
0
637
Member Avatar for Violet_82

Hi there, I am doing an exercise from a c++ book, but I get few errors that I can't seem to be able to fix, and I am not quite sure why. The exercise goes:" In a right triangle with dimensions side1, side2 and hypotenuse, find all Pythagorean triples for …

Member Avatar for Violet_82
0
876
Member Avatar for BlueZephyr

Hey everytime I run this it outputs the else of neither no matter what I enter. And I checked my conditions and the logic seems right but maybe I'm wrong. Help please! [CODE]#include <iostream> #include <cmath> using namespace std; int main(){ int n1, n2, n3; cout<<"Enter the three sides of …

Member Avatar for BlueZephyr
0
94
Member Avatar for HeartBalloon

[CODE] int findWord(char ma[][iSize], char ca[],int iRing,int& X, int& Y){ int ring=0,i=0,j=0,x=0,y=0,k=0,i2p=0, iLSide=0,iSSide=0; bool bOkay=true, bOver=false; ring = iRing--; iLSide=(iSize-(ring*2)); iSSide=(iSize-((ring*2)+3)); i2p=(iLSide*2)+(iSSide*2); x=y=i=ring; while(i>=ring && i<i2p && bOver==false){ j=i; switch(i){ // WHAT'S WRONG WITH THIS?!? WHY CAN'T I ASK A CASE MINOR OR EQUAL? case =< iLSide: x=ring; y=j; break; …

Member Avatar for HeartBalloon
0
175
Member Avatar for peck3277

Hey guys, I'm looking for some help in a project I'm undertaking. I have an AVR micro-controller sending data to my pc via the COM port. I want to write a c++ program, that will listen out for any data coming from the COM port and to write that to …

0
59
Member Avatar for lochnessmonster

im just curious on the purpose of pointers to pointers and when i would actually ever find the use of using one! thx

Member Avatar for Ancient Dragon
0
94
Member Avatar for smokin745

hello guys, i want my code to display the raw image "texture.raw", and at the same time, display a flashing text exactly besides it in a seperate viewport or with some other way. Please help me with this, as this code doesnt do that, it just flashes the image and …

0
91
Member Avatar for Nandomo

I want to use Ncurses on Dev-Cpp but don't know how to install it. I have downloaded the ndk for it, any help?

Member Avatar for Ancient Dragon
0
101
Member Avatar for marciaalanna

I am trying to finish this program that is due tonight. I have been working on it through out the week and thought I could figure out my errors with fresh eyes. I have got the number of errors down, but for some reason I keep getting errors like string …

Member Avatar for marciaalanna
0
105
Member Avatar for iamthesgt

This may be a simple fix, but I have a class for a program that contains some member functions that manipulate a vector. The vector is a private member variable, and is filled from an array using a constructor. When I try to access the member functions to manipulate the …

Member Avatar for iamthesgt
0
172
Member Avatar for ERadu

Hello! I am having some trouble with reading data for a list. If at the end of the file there is a new line character, this function reads the last set of data again, and then exits the loop. The addElem function works fine, I tested it separately. As there …

Member Avatar for arkoenig
0
289
Member Avatar for begineer

hi guys. i want a help on making directories in c++.i have used the code to declare and intilliaze the path name and folder name..but the probelem is that i want it to to ask from the user for the drive and folder name..i tried but i didnt get the …

Member Avatar for Ancient Dragon
0
190
Member Avatar for emreozpalamutcu

I have made a program using C++ Windows Form Applications and I don't want my program to run more than once. What is the code for this?

Member Avatar for Dingbats
0
109
Member Avatar for smokin745

Hi guys, I am doing a project wherein i have to make an OpenGL animation and its a Sainsbury advertisement and it kinda sucks till now. Now i really need to add images, viewports and be more creative. Following is the code till now, (yeah laugh at it...it sucks more …

Member Avatar for smokin745
0
191
Member Avatar for chamnab

Hi anybody do you know how to limit string that we input in the program ? LIKE THIS: Input Name: <-we can input only 5 characters

Member Avatar for jonsca
0
92
Member Avatar for jaepi

Hello, there. I'm having trouble with the initialization of variable of type sem_t. I used this. [code=c++] sem_t example; example = NULL; if(example == NULL){ /* code here */ } [/code] I'm getting the error, "no match for operator ==". What value do you think I should place in the …

Member Avatar for sfault
0
631
Member Avatar for glenn_boy13

hello there! I am new here on Daniweb. I couldn't find an article anywhere on google about moving text in C++. I have an idea but my problem is, I can't find a way to make my other output still. What I mean is: I don't know how to prevent …

Member Avatar for Mouche
0
1K
Member Avatar for Asif_NSU

Hi there C /C++ experts... I have a confusion regarding the function free(void *) in C and [I]delete[/I] in C++. Suppose there is a pointer named p. In C++, we dynamically allocate memory for p to point at like this [CODE] p = new int [10]. [/CODE],then when we use …

Member Avatar for ahtaniv
0
771
Member Avatar for wondernaet

I just posted this broken. Here is the code that works. I was told there is 2 ways this can be written more efficient. I can't see it, can you? #include <iostream> #include <string> using namespace std; void daysOfChristmas (int days, char switcher, string b[12]){(days > 0 && switcher == …

Member Avatar for VernonDozier
0
113
Member Avatar for iamthesgt

When writing a program that uses separate compilation (I have a header file, a .cpp file that declares all the member functions of the class in thee .h file, and an application file). I used a constructor to pass the contents of a dynamic array to a vector, but it …

Member Avatar for iamthesgt
0
283
Member Avatar for triumphost

Note: I program in C++ Not C#. In visual studio 2010, Where u press release or debug, next to it has a box with win32.. How can I change it to x86.. I tried pressing New and edit and stuff and configuration manager but it doesnt have the x86 choice... …

Member Avatar for Ancient Dragon
0
381
Member Avatar for HeartBalloon

Hi, I'd like to have a for condition with two interrupting conditions: [CODE] for(temp=hl;temp!=NULL,bOver1==true; temp=temp->next){ bOver=false; int I=0; while(bOver==false){ if(cu.Chars('S')[I]>temp->custs.Chars('S')[I]){ bOver=true; prev=temp; }else if(cu.Chars('S')[I]<temp->custs.Chars('S')[I]){ //FOUND THE ONE GREATER: PREV STAYS THE ONE BEFORE AND LOOP MUST END HERE! bOver=true; bOver1=true; } i++; } } [/CODE] This is a part of …

Member Avatar for HeartBalloon
0
166
Member Avatar for ndowens

I am writing a application for Arch Linux, actually I already wrote it, but I wanted to do it a little differently then the other. The origional one uses the goto statement. Here is the code: [CODE]#include <iostream> #include <string> using namespace std; int main() { cout << "\tAurDown v2.1\n" …

Member Avatar for jonsca
0
178
Member Avatar for declna0872

Hi all, im am writing a program to take in and store a student's grade as an int. Can anyone tell me please how do i get the average score of the grade? This is what i have so far... Regards. [CODE]#include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; …

Member Avatar for Saith
0
2K
Member Avatar for Rimojenkins

Hello again... My problem is that my if statement isn't working as I believe it should. Here is a snippet of the for loop. [CODE] for(int m=0; m<num; m++) { if(begllts <= intarray[m] && intarray[m] <= endllts); { cout << setprecision(4) << showpoint << dubarray[m] << "C" << stringarray[m]<< endl; …

Member Avatar for Saith
0
120
Member Avatar for HeartBalloon

Class homework: cannot use strings. How do I declare a function that passes me a cstring? char[5] for example. I need it to explicit a private member of a class. [CODE] class Customers{ private: caName[kiArraySize]; //kiArraySize is 30 public: //this is what I need help for char[] passName(Customers); }; char[] …

Member Avatar for gerard4143
0
92

The End.