49,757 Topics

Member Avatar for
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
873
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
180
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
628
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
766
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
111
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
380
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
Member Avatar for ckocina

im making a class called BigInt it will store integers in an integer array, 1 digit per array location(just ask if you need me to clearfy any more).....i have to make an addBigInt operation, subtract,setBigInt that will store an integer value into an existing BigInt, e.g. x.setBigInt(-397) replaces the value …

Member Avatar for ckocina
0
97
Member Avatar for Rimojenkins

Hey again! I've asked a question here once and have been lurking ever since. I was working on a new program and have come across problem. I don't really know what's wrong so I assume I overloaded something. The problem is in this snip of code [CODE]for(int m=0; m<num+1; m++) …

Member Avatar for Rimojenkins
0
11K
Member Avatar for lochnessmonster

im quite confused on how typedef int (__cdecl *MYPROC)(LPWSTR); works exactly? how do you typedef a function? any explanation is greatly appreciated! thx :D [CODE]// A simple program that uses LoadLibrary and // GetProcAddress to access myPuts from Myputs.dll. #include <windows.h> #include <stdio.h> typedef int (__cdecl *MYPROC)(LPWSTR); VOID main(VOID) { …

Member Avatar for mike_2000_17
0
556
Member Avatar for Rickay

[CODE]#include <iostream> #include <windows.h> #include <ctime> #include <cmath> #include <iomanip> #include <string.h> double numerator, denominator; static short multiplycounter; static short dividecounter; const double ten = 10; double* ppnumerator = &numerator; double* ppdenominator = &denominator; using namespace std; /**********************************************************************************/ double lcm(double numerator, double denominator) { if(*ppnumerator > *ppdenominator) { for(long counter …

Member Avatar for frogboy77
0
189
Member Avatar for DaniwebOS

For some odd reason, I can't get anything to be displayed when the program is running. I believe its not passing anything at all which would explain the blank console. If anyone could help me out that would be great. Without using functions the program successfully shows: 1) Student's name …

Member Avatar for DaniwebOS
0
130

The End.