49,761 Topics

Member Avatar for
Member Avatar for becool007

Hey Daniweb Community, I enter in the following code into a header file: [code=c] bool isCreated; [/code] And as a result I get the following error: [COLOR="Red"]error: expected '=', ',', ';', 'asm' or '__attribute__' before 'isCreated'|[/COLOR] Any suggestions or information on how this problem is occuring? Computer Specs: Windows 7 …

Member Avatar for Ancient Dragon
0
94
Member Avatar for arguav74

Hi everyone, I am new to C++ and I'm having difficulty getting this program to work to calculate Haistone numbers. So please - any advice or solution as to what I'm doing wrong would be greatly appreciated. The program is to take two numbers, and then for each number in …

Member Avatar for Ancient Dragon
0
365
Member Avatar for akase2010

[CODE]#include <iostream> #include <cstring> #include <cctype> using namespace std; class Car { private: int YearModel; int Speed; string Make; public: Car(int, string, int); string getMake(); int getModel(); int getSpeed(); void Accelerate(); void Brake(); void displayMenu(); }; Car::Car(int YearofModel, string Makeby, int Spd) { YearModel = YearofModel; Make = Makeby; Speed …

Member Avatar for akase2010
0
136
Member Avatar for juangalvez4

Hi guys, I am having a bit of trouble. I've come to realize that my book does a poor job to explain a lot of concepts in detail. I am trying to use functions in the folowing code. [CODE]#include <iostream> //For cin and cout using namespace std; int main(void) { …

Member Avatar for juangalvez4
0
118
Member Avatar for welp

b.cpp [CODE] #include"a.h" #include"a.cpp" int main(){} [/CODE] a.cpp [CODE] #include"a.h" a::a(): b(0) { } [/CODE] a.h [CODE] #ifndef A #define A class a{ int b; a(); }; #endif [/CODE] Getting; "1>b.obj : error LNK2005: "private: __thiscall a::a(void)" (??0a@@AAE@XZ) already defined in a.obj" when trying to compile. Using Visual Studio 2010, …

Member Avatar for Ancient Dragon
0
262
Member Avatar for vincezed
Member Avatar for L3gacy

Hey everyone, My problem is that in my program below I made an indefinite loop for comparing strings and values, my problem is on line 60 & 61, the loop automatically accepts whichever if statement is on line 60 when I test for an uppercase and lowercase char, as soon …

Member Avatar for L3gacy
0
231
Member Avatar for dcasmac418

hi! can anyone help me determine the sorted values of the array in this script. [CODE] for (x=0,x<=4,x++) for (y=0,y<=3,y++) { if(num[y]>num[y+1]) { temp=num[y]; num[y]=num[y+1]; num[y+1=temp; } { [/CODE]

Member Avatar for jonsca
0
103
Member Avatar for knight92

Hi, another question from someone who is interested in learning more about C/C++. My question is that everyone says C/C++ is more powerful than many other languges e.g Visual basic but why is it more powerful. Is it because of the pointers ? As far as my knowledge goes they …

Member Avatar for Adak
0
353
Member Avatar for comSysStudent

Hi all, I'm mostly into my Java so I'm not even sure if I gave the post a proper heading. Basically I'm trying to read two matrices from the command line and print them out. Reading works as far as I can tell but when my program tries to call …

Member Avatar for comSysStudent
0
213
Member Avatar for lashatt2

why this code doesn't work. I want to do, I have 3 numbers( x1,x2,y1,y2; ) in editbox and it makes an equation y2=x2/x1*y1; and after this what we will receive in y2 it will be writen on hwnd [CODE]#include <windows.h> #include <stdio.h> HWND hwnd1,hwnd2,hwnd3; WCHAR x1[MAX_PATH],x2[MAX_PATH],y1[MAX_PATH],y2[MAX_PATH]; wchar_t str[MAX_PATH]; /* Declare …

Member Avatar for Frederick2
0
137
Member Avatar for miturian

So, in the course of a numerical simulation I have noticed that if I save and load the state of my system (a large number of doubles), the following behavior of the system will be slightly different from if I just kept the info "inside the program" and didn't bother …

Member Avatar for miturian
0
183
Member Avatar for alex55

I have this string function that should calculate the average of and array compare the values of the 12 numbers and output which month has the highest temperature -(0-11) = (Jan-Dec) -all variables not defined in the function are defined globally The problem is when I compile and run the …

Member Avatar for alex55
0
129
Member Avatar for pinky khan

Iam using graphics.h header file for the first time.plz tell me how the following program is written: write a program to print "Hello world" three times in different colors and fonts with yellow background colour using graphics.plzzz give me the answer.

Member Avatar for JSPMA1988
0
105
Member Avatar for ikiag

how to announce a table in c++? i know it goes with "for" for (int i=0;i<10;i++;) {for (int j=0;j<10;j++;) }

Member Avatar for ikiag
0
109
Member Avatar for Kanoisa

Hi all, I have begun workin on getting c++ to do physics and things for me so im working on some maths functions. starting small and working up, Just did this one on prime number generation and was wondering if anyone can point out any ways it could be ,made …

Member Avatar for Kanoisa
0
284
Member Avatar for dpreznik

Dear experts, Could you please tell me if it is possible to have a multiline caption for a Group Box? I have a GroupBox that uses a checkbox as a title. The style of the checkbox is set like this: [CODE] m_TitleBox.Create(strText, BS_AUTOCHECKBOX | WS_CHILD | WS_TABSTOP, rc, this, ID_TITLE); …

0
44
Member Avatar for prtipal.singh88

i want to create a [B]virtualisation softwar[/B]e (like vmware ) which can run single operating system virtually i was searching for this from past few days but [B]not able to know much about coding part[/B] So plzzz help me out in this i have to submit it as my project …

0
50
Member Avatar for lochnessmonster

im curious as to the point in flushing streams? why is it necessary to do this? i never find input being left inside a buffer and needing to get forced to my output display :/

Member Avatar for lochnessmonster
0
145
Member Avatar for negneg

Hi Everyone, I am trying to compile a code and I keep getting error C2064: term does not evaluate to a function taking 1 arguments here is my code(actually I got it from a book),can anyone help me what is wrong? thanks Negin #include <iostream> #include <math.h> using namespace std; …

Member Avatar for negneg
0
198
Member Avatar for beejay321

I was wondering whats the simplest way to count and sort the elements of each array when using a set like [CODE]char list[40][30];[/CODE] theyre being brought in from a text file that would simply look something like this apples bannanas oranges grapes i would need to count each element, sort …

Member Avatar for pseudorandom21
0
177
Member Avatar for ajst

Hi, I've got a job interview coming up and was wondering if people would be so kind to help me with some revision for the interview. It's it a programming role(surprisingly) so would be greatful if people would post the questions they have been asked or ask in job interviews. …

Member Avatar for Moschops
0
91
Member Avatar for ravenous

Hi guys, I'm sure that the answer to this is simple, but I don't know what it is and it's bugging me. For reasons that aren't important, I'm trying to make a kind of light-ish weight array class. I want to be able to use syntax like that of [icode]std::vector[/icode] …

Member Avatar for ravenous
0
251
Member Avatar for ahtaniv

1. Do we have static classes in C++? 2. If so what are they useful for? 3. Is this the name given to classes that should not be allowed instantiation? 4. If so, how is it different from abstract classes?

Member Avatar for Narue
0
185
Member Avatar for Infame

Hi! I made a little snippet to play around with... [CODE]int readThis::compareData(readThis &Source) { string sBuff, sBuffcpy; this->cFile.open(zsFile), (&Source)->cFile.open((&Source)->zsFile); if (this->cFile.is_open() && (&Source)->cFile.is_open()) { while(!this->cFile.eof(), !(&Source)->cFile.eof()) { getline(this->cFile, sBuff), getline((&Source)->cFile, sBuffcpy); if (sBuff == sBuffcpy) { if (this->cFile.eof() && (&Source)->cFile.eof()) { return FILE_SUCCESS; exit(1); } } else { return FILE_NOT_SUCCESSFUL; …

0
49
Member Avatar for aguilaron

I am having trouble with this program in the if else part I feel that is a really simple problem, I have tried 'else if' as well as 'else' but all sorts of errors come up. [CODE] #include <stdlib.h> #include <iostream> using namespace std; int main() { double a, b, …

Member Avatar for Narue
0
1K
Member Avatar for Charlton21

I need to turn this code for a class that checks for a out-of-bound value: class array {public : int & operator [] (int); // Prototype; overloaded operator int size () // In-line function {return ub - lb + 1; }; int lbound () {return lb; }; int ubound () …

Member Avatar for Narue
0
303
Member Avatar for pawan_sharma777

Buddy , i have problem in to combine sql with c++ plzzz any one help for this issue hurry friends i have a library project to combine it with database. hellppppppppppp meeeeeeeeeeeeeeeee.............

Member Avatar for sheva249
-1
171
Member Avatar for cpp_learn

Hi, I need to do the following: 1. read the text file with names and surnames 2. convert each char to int than add them 3. the number must keep adding each other until it is under 10 This is what I have so far ====================================================================== #include <iostream> #include <fstream> …

Member Avatar for jonsca
0
563
Member Avatar for Kamal_Java

HI I have a Map Image that I got from OpenstreetMap(Osmarender Image ) .My question is how to convert geographic coordinates to the co-ordinates of my picture (that is in pixels on X and Y on a picture). That is I receive geographic coordinates and it is necessary for me …

Member Avatar for jonsca
0
113

The End.