49,757 Topics

Member Avatar for
Member Avatar for lalavoodoo15

I am trying to understand how [bool hasaletter(string, char(c))] works. after boolhasaletter appears, if it is true, i want to add to total_num. I have tried if(true) { and it did not work. so basically, im trying to see if a string has a character user inputted. [code=c++] int main() …

Member Avatar for Duoas
0
69
Member Avatar for freakybeavis

I'm new here and fairly new to c++. Not sure if this forum is exclusivly for students because I am not one, just learning it for fun. I read the "read me" on flushing the input stream but it seemed rather complicated. What's happening is if the correct color is …

Member Avatar for Duoas
0
2K
Member Avatar for tnvkrishna

hello, i have a header file (intl.h)which contains the declaration of members of class intl and the members functions are defined in 5 different headers and i have one more header (floatl.h) which contains the total declaration of class floatl and it's member functions the over view is something like …

Member Avatar for vijayan121
0
116
Member Avatar for lalavoodoo15

Hi, i am trying to make a program that gets words from a txt file (strings) and see if the words have the character the user has inputed before. for example... the program will ask the user to input a letter. ( the user inputs, lets say a letter 'k') …

Member Avatar for Ancient Dragon
0
104
Member Avatar for Flakester

I've ran into a problem :( Something is wrong between my functions. When I try to take 'num' from the main function and put it in the getFib() function, it turns into some crazy number, sometimes random. Why wont it stay the same number that was declared in main? Sorry …

Member Avatar for WaltP
0
116
Member Avatar for IzzoYourNizzo

[B]This is the problem.[/B] Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to the last, and so on, all the way to the middle of the array. Given an array a , an int …

Member Avatar for WaltP
0
124
Member Avatar for helixkod

Heres the part of the code That i have: [CODE] #include <iostream> using namespace std; const int NUM_DIV = 6; //Number of divisions const int NUM_QTRS = 4; //Number of quarters void divisionSales(double [][NUM_QTRS], int); void divisionChange(double [][NUM_QTRS], int); void quarterSales(double [][NUM_QTRS], int); void quarterChange(double [][NUM_QTRS], int); int main() { …

Member Avatar for Ancient Dragon
0
266
Member Avatar for dblbac

i have made the following but the user should get 10 chances to guess the right number. after the 10 guesses or if the the guesser gets it correct it should ask if the player wants to play again and react accordingly. [code=cplusplus] #include <iostream> #include <cstdlib> #include <ctime> using …

Member Avatar for dblbac
0
153
Member Avatar for Shay_

Hi all, I have a very weird problem. I develop a game on Nintendo DS using DevKitPro. I have a method that get a value in an XML file : [code]sscanf(xEffect.getChildNode("mpmodif").getAttribute("value"), "%d", &mpModif);[/code] With the values I have get, I instanciate a new Effect : [code]Effect *test = new Effect(durationTime, …

Member Avatar for Salem
0
70
Member Avatar for HLA91

Hi all My friend sent me this C++ program that opens up notepad and starts typing, its a joke he made to scare his little brother, I tried to modify it to display more of the message "Im watching you" but when I do it wont compile and I dont …

Member Avatar for HLA91
0
138
Member Avatar for picass0

i have a code for complex number but when i key in 7+i3 and 5+i2 into the operator+ it should return me the result of 12,5 but i receive 430. What is the problem wif my code? [code] class Complex { friend istream& operator>>(istream&, Complex&); friend ostream& operator<<(ostream&, const Complex&); …

Member Avatar for Narue
0
81
Member Avatar for vaishal

1. Create a file with the following data: No of students on file – type integer Then for each student Student ID Number-type long Student name- type integer[81] Total credits- integer Grade Point Average- float Sample data: 3 0558899 Roger, R. 12 3.8 5646489 Jack, J. 24 2.5 1641564 John, …

Member Avatar for Lerner
0
95
Member Avatar for c++ prog

i'm new to c++....i'm making a project here but i have a problem with this: reading values as type char and converting it to type int...such that 54 can be read as '5' and '4' but after that it will be read into type int...can anyone please tell me how?

Member Avatar for Narue
0
87
Member Avatar for m16jim

I have a question on an assignment that has me confused. The question is how many times does the following loop execute? For I = 1 to 10 PRINT I End For (I) Now I am not sure if this is a trick question or not. I do not see …

Member Avatar for Narue
0
122
Member Avatar for c++ prog

i'm new to c++....i'm making a project here but i have a problem with this: reading values as type char and converting it to type int...such that 54 can be read as '5' and '4' but after that it will be read into type int...can anyone please tell me how?

Member Avatar for Ancient Dragon
0
80
Member Avatar for jaepi

Hello there. Is there anyway that you can convert the '\n' in windows which is 2bytes to the '\n' 1byte so that the linux could read it?

Member Avatar for vijayan121
0
161
Member Avatar for nurulshidanoni

hello, why the output below produce number 0, eventhought there is no 0 in the array? [code=c++] #include <iostream> #include <conio.h> #include <cstdlib> #include <cmath> #include <cstdio> #include <ctime> using namespace std; int i; int x[7]; int A[7], B[7], C[7], D[7], E[7], F[7]; int Min( const int *A, const int …

Member Avatar for Nick Evan
0
156
Member Avatar for geekychick

can someone tell me why my getline statements aren't working correctly? My compliler seems to just skip over them in my functions... here's my code: #include <iostream> #include <string> using namespace std; void locate(string[],int&); void substitute(string[],int&); const int MAX_LINES=7; int main ( void ) { char command; int i,currentLine; string …

Member Avatar for geekychick
0
87
Member Avatar for helixkod

Heres the situation: I am taking a C++ course online. I had a PC up until about a week ago when i got a Mac. Now i must do all my work on the only computer i have, the Mac. I turn in my work at the end of the …

Member Avatar for vijayan121
0
175
Member Avatar for SurviBee

I'm using a class to generate a list of primes. Im checking a series of numbers being incremented by two against the current vector of primes to see if any primes divide into the number evenly. If no primes divide into it I add the number onto the end of …

Member Avatar for vijayan121
0
245
Member Avatar for jadedreality

I know this is simple, but I need a bit of help. I need to write a program that will prompt the user to enter three integers, and should then print the numbers in ascending order. The hint the teacher gave was to use scanf three times? I'm just confused...

Member Avatar for jadedreality
0
385
Member Avatar for mandsmom

Hi, I have never used a forum like this before but I am stuck! I have to write a C++ program that allows the user to enter up to 20 students info. It must include Nem, Exam 1 grade, exam 2 grade, Homework average, final exam average. For each student, …

Member Avatar for WaltP
0
227
Member Avatar for kodiak

Hi, I am an intermediate c++ programmer, and I'm looking for a tutorial on Visual C++ express edition. If anyone could point me in the right direction with a link (I've searched google, and just get loads of stuff from microsoft, or things that are irreleveant.), it would be help …

Member Avatar for Ancient Dragon
0
140
Member Avatar for gator6688

I need to assign each student a letter grade. The way I have it set up now it assigns the letter grade of the second student to both students. How can I get it to assign each student their own letter grade? Also, I would rather output the letter grade …

Member Avatar for gator6688
0
324
Member Avatar for Jacky1

Hi guys I'm doing a program for one of my class but the teacher asked us to write a language mangler to modfiy a sentence and make it nonsentence And he want us : - If any word has length 9 or more characters, insert into the word after the …

Member Avatar for Narue
0
98
Member Avatar for Alethea

heya... can any1 plz help me write this program. write a program that the user is converting from and to base, and also from value. thx

Member Avatar for Narue
0
132
Member Avatar for zandiago

Good day. My semester of c++ is coming to an end. I've got to complete a total of 7 assignments within the next 3 weeks. I've completed 5 out of the seven. I've got two left (1 has a separate thread by itself). So you can also take a look …

Member Avatar for Nick Evan
0
186
Member Avatar for dockuvn

Help me. My teacher force me make dll by C++ instead of VC or VB... I have searched anywhere and ask many people but I couldnt find out the way to do it. Please help me ASAP. Best regards

Member Avatar for Narue
0
24
Member Avatar for AXAsianXie

Hi can someone look at this program for me it wont fill out the whole address for me and when i search or go delete it doesn't do anything. [code=c++] #include<iostream.> #include <fstream> using namespace std; struct Person { char Name[50]; char Address[80]; char Phone[30]; }; void add(); void search(); …

0
66
Member Avatar for AXAsianXie

Hey i have a HW to do an address book storing the names addresses and phone #s and add to address.txt. and the phone is the key so i have to create a search using the phone #. i'm also suppose to use a mygetline function that i don't quite …

Member Avatar for Salem
0
117

The End.