49,766 Topics

Member Avatar for
Member Avatar for cypherscouter13

I try to run the following, but I keep getting the error "error C2664: 'Card::SetName' : cannot convert parameter 1 from 'const char [23]' to 'char'" I also got the following error; error C2664: 'Beginning' : cannot convert parameter 2 from 'std::vector<_Ty>' to 'std::vector<_Ty> &' I'm not that familiar with …

Member Avatar for cypherscouter13
0
163
Member Avatar for opawix

Hello ma'am/sir any help for the codes of input to be align.heres my code: [CODE] #include<iostream> using namespace std; int main() { float pre, mid, semi, final, total; cout << "Prelim: "<<setw(20)<< "Midterm: "<<setw(20)<< "Semifinal: "<<setw(20)<< "Final: "<<setw(20)<< "Final grade: \n"; cin>>pre>>mid>>semi>>final>>total; total = (pre+mid+semi+final)/4; system("pause"); return 0; } [/CODE] …

Member Avatar for namratag
0
103
Member Avatar for Powerponken

Hi, This is probably some basic knowledge but I haven't found it out. I have this snippet of code that is causing me problems: [CODE] HANDLE hFile; char lpBuffer[100] =""; char idBuffer[100] = ""; DWORD ofs; strcpy(lpBuffer, fingerprint); strcat(lpBuffer,"\0"); hFile = CreateFile(buffer,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL); WriteFile(hFile,lpBuffer,sizeof(lpBuffer), &ofs, NULL); strcpy(buffer,""); if(ReadFile(hFile, …

Member Avatar for Ancient Dragon
0
181
Member Avatar for hariharan89

Hi , I am a newbee to visual c++ 2008, I have to include a RTP prtocol library JRTPLIB into visual c++ 2008. could any one please brief the steps to do it. I dont know how to include these libraries into visual c++. with regards, Hari

Member Avatar for MonsieurPointer
0
108
Member Avatar for jonnyboy12

Hello. I am i'm recently taking off in building a game. The problem at the moment, is that i fear i'm programming to much! I wouldn't know this because i'm new to c++, but how much code is too much for a modern processor? In my engines render loop i …

Member Avatar for sundip
0
300
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
113
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
216
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
110
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
159
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
277
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
506
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
142
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
266
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
76
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
139
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
477
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
295
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
297
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
190
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
442
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
87
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
596
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
117
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
180
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
111
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
177

The End.