49,761 Topics
| |
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 … | |
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 … | |
[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 … | |
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) { … | |
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, … | |
How can one bring graphics component in C++ to work under C# | |
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 … | |
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] | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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++;) } | |
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 … | |
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); … | |
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 … | |
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 :/ | |
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; … | |
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 … | |
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. … | |
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] … | |
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? | |
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; … | |
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, … | |
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 () … | |
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............. | |
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> … | |
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 … |
The End.