49,761 Topics

Member Avatar for
Member Avatar for Tom_Weston

What i basically want is more than one character to be found. If h and a are in the string then it will print it. But it will only work if there is a single char. [CODE] #include <iostream> #include <stdio.h> #include <string.h> int main () { char str[] = …

Member Avatar for MonsieurPointer
0
111
Member Avatar for clide890

Hello, I've been having problem with this problem since yesterday and i just recently started C++, so please don't judge. I have very confused to what the question is asking and how the C++ program will look like. Effective January 1st of each year, Gabriela receives a 5% raise on …

Member Avatar for WaltP
0
214
Member Avatar for crane476

I am writing a program that should allow the user to enter however many payroll amounts they want for 3 different stores. It should then display the total payroll for the three stores. The first time through the loop is fine but the second time through, even though it appears …

Member Avatar for crane476
0
109
Member Avatar for George_91

My first thought was [CODE] int size = 0; cout << "Enter size of the array" << endl; cin >> size; int a[size]; [/CODE] Now I know that an array has to have a constant value, but I need that the user enters an integer and use that integer as …

Member Avatar for gerard4143
0
158
Member Avatar for glut

Hey, I need to make a function that returns an array. How would I do so? And how would I make a variable that gets all the values in that function? Thanks, you guys :)

Member Avatar for sergent
0
275
Member Avatar for George_91

I've this quicksort code, and it compiles. The thing is, I don't know how to give random values (integers) to the vector. The program should ask for the vector's size and then create the x random integers so it can apply the quiksort method. [CODE]#include "stdafx.h" #include <iostream> #include <vector> …

Member Avatar for George_91
0
2K
Member Avatar for digipak

Hello, I have a class Pdisk [CODE] class Pdisk { public : Pdisk(string diskname, int numberofblocks, int blocksize); private : string diskname; int numberofblocks; int blocksize; }; [/CODE] Now I want to make a class filesys which can access an object of class Pdisk. I am not sure how to …

Member Avatar for StuXYZ
0
504
Member Avatar for TheChosen0ne

Hey guys, I need some help. I'm using Microsoft Visual C++ 2010. I've heard about being able to write html in c++ I found a few tutorials but I can't understand them they're not very noob friendly. :( Can some of you guys give me a few codes so I …

Member Avatar for Moschops
0
136
Member Avatar for cypherscouter13

I keep getting these error messages: "error LNK2019: unresolved external symbol "void __cdecl MainPhase(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *)" (?MainPhase@@YAXPAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) referenced in function _main" "error LNK2019: unresolved external symbol "void __cdecl DrawForKaiba(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > …

Member Avatar for sfuo
0
262
Member Avatar for ucdbrummy

I'm new to this site and am desperate for help. I'm learning C++ for university, and have just received my second project. it goes like this: Write a program in which: A random integer between 0 and 500 is generated at the beginning. The user is asked to guess the …

Member Avatar for ucdbrummy
0
74
Member Avatar for xenan

hi can someone helped me in my triangle ><? my prof told me to make a program that ask the user to input the height of the triangle and the user must be able to input the height.. and the triangle must be a triangle not a right triangle.. this …

Member Avatar for gerard4143
0
137
Member Avatar for DriftingFable

Hello Daniweb, I am a student in my CSC 194 using Visual C++ 2008. I am designing a program according to these standards. Most of my knowledge is strictly textbook information so bare with me. [QUOTE]Imagine you are developing a software package that requires users to enter their own passwords. …

Member Avatar for DriftingFable
0
474
Member Avatar for matt_570

Hey I have this tough assignment that just keeps on getting harder and harder. I have 3 more functions to complete. Function1: I have to print the positions of the three consecutive values that have the largest average. If more than 3 consecutive values have the same average, print the …

Member Avatar for pratik_ghulaxe
0
1K
Member Avatar for vlaskiz

As you may guess I'm pretty new to c++. I'm asked to write a program which would read and out put data files. Now im halfway through (that's why I'll ask you not to mind lots of what is on current code) but I'm stuck on this certain error for …

Member Avatar for vlaskiz
0
294
Member Avatar for swissknife007

What are the settings I require so I can debug line -by line? Or else ,I can identify lines of code where run time errors are occuring.. I want to view exact line number of error in this code/[CODE]#include<stdio.h> #include<conio.h> #include<string.h> struct node {struct node * left,*right; int freq; char …

Member Avatar for gourav1
0
296
Member Avatar for rcowboy

Hello all, I'm getting an error in the following code, and I can't figure out why exactly. Error is as follows: no match for 'operator>>' in 'scoresIn >> scoresArray' this is at line 28 on the code below. I'm trying to bring in some data from a text file into …

Member Avatar for rcowboy
0
187
Member Avatar for Zssffssz

Well when I run my program the bar at the top says C:\programing\C++\Test\Test.exe (<<just an example) How do I change this? And how do I make the console window look more XPish (I heard it was called luna). Answer the title one first please. I wnt this too be all …

Member Avatar for NathanOliver
0
429
Member Avatar for Tom_Weston

So example.txt contains this; [B]The Man Walked Into The Forest[/B] What I would like is for it to show, what line the word "Walked" is on. [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; string word = "Walked"; ifstream myfile ("example.txt"); if …

Member Avatar for Tom_Weston
0
84
Member Avatar for ben1996123

How do I create a message box that lets me display a variable? I also need to know how to display variables with text. Here is the code in the switch(message) statement that I have at the moment that doesn't work. [CODE] case WM_CREATE: CreateWindow( TEXT("button"), TEXT("Click"), WS_VISIBLE | WS_CHILD …

Member Avatar for Frederick2
0
587
Member Avatar for Sudo Bash

Hi all, I am trying to create a class to serve as a customized cout class. Right now I have made some test code to see if I can do it. Right now I am trying to make it function just like cout, but later I will have it do …

Member Avatar for Sudo Bash
0
2K
Member Avatar for maybnxtseasn

[url]www.learncpp.com/cpp-tutorial/103-aggregation[/url] In the example given they state a department can have a teacher and if a department goes out of scope/deconstructs it doesnt destroy the teacher that was in that department. for example in real life departments at different school change names,get added,and get deleted all the time. Just because …

Member Avatar for maybnxtseasn
0
115
Member Avatar for trantran

Why is this possible (in VS2009): [CODE] struct outer{ struct inner1{ void f(){ inner2 in2; in2.g(); /* no previous forward declaraction*/ } }; struct inner2{ void g(){} } }; [/CODE] ... but not this (???) [CODE] struct outer{ /* This line required to remove error: struct inner2; */ struct inner1{ …

Member Avatar for trantran
0
178
Member Avatar for alexander1s

i have to count three districts 1, 2, 3 whom said no and whom said yes, which i had saved it in notepad the three districts. i have to use the while loop. i was trying ifstream iFile; inFile.open("vote.dat") while(district1 == yes) { cout <<"the district 1 said yes: "; …

Member Avatar for ben1996123
0
109
Member Avatar for masre

hey everyone, m doing an assignment on bouncing ball,my code below doesn't bounce the ball,it just makes it move when the enter button is used,what can I do to make the ball bounce? [CODE] #include<alloc.h> #include<graphics.h> #include<conio.h> #include<stdlib.h> #include<dos.h> void main() { int d=DETECT,m; initgraph(&d,&m,"H:\\tc\\bgi"); int l=getmaxx()/2,t=0; int x=1,y=1; int …

0
50
Member Avatar for anu07

The output I expected was: [ICODE]alpha beta[/ICODE] I used the following code: [CODE]#include<iostream.h> #include<conio.h> void main() { clrscr(); char choice[2][5]={"alpha","beta"}; cout<<choice[0]<<endl; cout<<choice[1]; getch(); }[/CODE] But this is what comes: [ICODE]alphabeta beta[/ICODE] Can anyone tell me what I did wrong? Thank you. P.S.:I know I am not using standard c++, but …

Member Avatar for anu07
0
175
Member Avatar for nuclear

Trying to do some basic "Game of life", but for some reason i'm getting some weird results, the code: [CODE]#include "stdafx.h" #include "stdlib.h" #include <iostream> using namespace std; #include "windows.h" const int V=30;//Vertical const int H=40;//Horizontal char A[V][H]; int ne=0; //Set all to dead void setDead() { for (int i=0;i<V;++i) …

Member Avatar for nuclear
0
694
Member Avatar for KyleSmith10

I'm sorry as this coding language is not in C++, but it is very simlar to it. I basically trying to learn how it works if I have an example of this: [CODE]new NodeArray[] { {0,0,0,0}, {1,1,1,1}, {2,2,2,2}, {3,3,3,3} }[/CODE] I want an example of it working on how to …

Member Avatar for KyleSmith10
0
245
Member Avatar for Z33shan

hello! i have to compile World of Warcraft (online game) server.. its been a week i'm looking for "Microsoft Visual C++ EXPRESS edition - 32-bit" for windows7. but i couldn't find it. does it exist? if so, then kindly give me the exact link to download it. recently i installed …

Member Avatar for mjdodd
0
136
Member Avatar for QQnoobie

I am trying to write a function that will compute GPA. [CODE]#include "Student.h" #include "ClassInformation.h" Student* setupStudent(){ string f,l,idNo; double gPoint=0; Student *studPtr1; studPtr1 = new Student (); cout<<"Enter first name "; cin>>f; studPtr1->setfirstName(f); cout<<"Enter last name "; cin>>l; studPtr1->setlastName(l); cout<<"Enter A number"; cin>>idNo; studPtr1->setaNumber(idNo); cout<<endl; studPtr1->setGPA(gPoint); return studPtr1; } …

Member Avatar for QQnoobie
0
265
Member Avatar for Labdabeta

Is it possible to put a gap in a class definition? IE: [CODE]class a; class b { private: a test; public: a getA(){return test;} }; class a { private: int i; public: a(int i):i(i){} a operator+(int o)const{return a(i+o);} }; class b continued?//what? how? { void outputA(){cout<<a;} };[/CODE] This is just …

Member Avatar for Labdabeta
0
178

The End.