49,761 Topics

Member Avatar for
Member Avatar for Vasthor

hey guys, k, already 1 month I'm "leaving" my self-study on C++ for certain personal reason, I just learned the C++ two months before also, not much... I still can type in code and remember how most of the keyword works(that I learned), but I'm losing my ability to "think …

Member Avatar for thines01
0
141
Member Avatar for mweshk

Hi Gurus, I have an assignment am doing. The user should enter details of 5 students and return results on the screen.I have the code below and its return 1 error. Can someone kindly help me.With regards #include<iostream> #include <string> #include <sstream> using namespace std; int main () { typedef …

Member Avatar for DJSAN10
0
116
Member Avatar for Sunshine2011

I wrote a little program to read soma data from a *.txt file. The content of the file is "5 , 10, 15". The program shall identify the numbers, e.g. "5" and "10" and "15". This works until the last two numbers. Unfortunately the program doesn't read the last two …

Member Avatar for DJSAN10
0
104
Member Avatar for rohan121212

So here is what i have done I did the basics of c++ and was quite comfortable with them Now i wanted to start with the allegro gaming library so i downloaded the library and linked it with my compiler i compile a program and it compiles fine but when …

Member Avatar for DJSAN10
0
108
Member Avatar for butler273

So, as follows I have a basic while loop. It's working fine, however whenever I enter something other than a number or EoF, it goes through the loop one time after I'm wanting it to stop. Say I enter 5, then EoF, it enters an extra 5, so I have …

Member Avatar for subith86
0
151
Member Avatar for Aarowaim

I'm working on a simple program in which the user types a sentence, the program iterates through the string that the sentence in stored in and alternates each letter's case, and then puts the formatted text into the clipboard. I know exactly how to allow input and change case/check if …

Member Avatar for Aarowaim
0
270
Member Avatar for stevanity

Hello guyz! Im conducting a debugging contest... Im writing some questions... I wrote a code implementing virtual functions.. Im not sure where to include bugs here.. Can anyone help me add bugs to this code?? Please bugs must make people think.. THey must not just be syntactical errors.. Thank you.. …

Member Avatar for Zcool31
0
107
Member Avatar for darshilpatel34

[TEX]Hi I'm into a code in which I have to Design a class named Account that contain: 1. Int data field named "id" for the account. 2. Double data field named "balance" for the account. 3. Double data field named annualInterestRate that stores the current interest rate. 4. A no-arg …

Member Avatar for VernonDozier
0
180
Member Avatar for devindamenuka

hi all, here with I attach a programe written from using C++ language. I am new to C++. problem is I want to be a good programmer and I think I still do mistakes in witting programes. what I want is check my code and criticize my mistakes. tell me …

Member Avatar for Zcool31
0
870
Member Avatar for CY0T3R

/*PROGRAM TO PRINT SUM OF THE FOLLOWING SERIES - X + X*X/2! + X*X*X/3! + X*X*X*X/4!....n terms. I'm not getting the correct output. eg-for n=3 and x=2; compiler's ans = 4.66 correct ans = 5.3. HELP ME OUT...*/ [CODE]#include<iostream.h> #include<math.h> #include<conio.h> void main () { clrscr(); float x,sum=0; int n,fact=1,j,k; …

Member Avatar for CY0T3R
0
217
Member Avatar for randrum1707

Hello everyone, I'm having a problem with an assignment that I'm not sure how to fix I'm getting the following error: accountdb.cpp:55: error: cannot convert std::string to const char* for argument 1 to int strcmp(const char*, const char*) Here is my header file: [CODE] #ifndef ACCOUNTDB_H #define ACCOUNTDB_H #include "account.h" …

Member Avatar for randrum1707
0
1K
Member Avatar for ecin

I'm using visual c++ 2008. I don't know what namespace system and system::Glob.. are. I've never used "wchar_t" nor Console::Write. Is there a way to display unicode characters with the C++ that was taught to me in school? It looks that ASCII II is supported by using the char datatype …

Member Avatar for jackwu
0
4K
Member Avatar for strizh

Can somebody help me figure out what I did wrong with my default constructor declaration I'm getting an error message no appropriate constructor available Thanks [CODE] TimeOff.h class TimeOff { private: string name; int id; NumDays maxSickDays; NumDays sickTaken; NumDays maxVacation; NumDays vacTaken; NumDays maxUnpaid; NumDays unpaidTaken; public: //default constructor …

Member Avatar for Topi Ojala
0
220
Member Avatar for C++ programmer

What does this statement mean "[B]These functions (read(), readline(), readAll()) read a line of ASCII characters from the device, [U]up to a maximum of maxSize - 1 bytes, stores the characters in data, and returns the number of bytes read[/U].[/B]" I have used readAll() and readLine() it returns all the …

Member Avatar for thines01
0
143
Member Avatar for shywolf91

Here is a c++ program I have been working on for an intro c++ class: [CODE]//hangman //Dylan Metz #include <iostream> #include <string> #include <fstream> #include <cstring> using namespace std; //functions //double index(); int main() { int const SIZE=22; char name[20]; char dash[SIZE]={" "}; char q; //The User's Guess int NumOfGuess=6; …

Member Avatar for augustus7
0
154
Member Avatar for triumphost

I have: [CODE] class ANew { private: vector<CustomType> ArrayOfTypes; public: ANew() : ArrayOfTypes(0) {} ~ANew() {} ANew& operator ()(int I) { return ArrayOfTypes[I]; } operator const ANew* () const { return ArrayOfTypes; } }; [/CODE] But it gives me these errors: [ICODE]C++\Types.h|12|error: invalid initialization of reference of type 'ANew&' from …

Member Avatar for mike_2000_17
0
139
Member Avatar for myk45

Hello, I'm trying to use the compiler optimizations for GCC 4.3.3. I used the following [URL="http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html"]LINK[/URL]as a reference. I'm mainly using the O2 and Os levels of optimizations. Could anyone please let me know if the order in which the options matters? Thanks in advance!

Member Avatar for myk45
0
203
Member Avatar for stereomatching

I am studying the source codes of SGI STL and have many problems with it. I can't figure out the design choice of the iterator of SGI STL as follow [code] template <class _Tp, class _Ref, class _Ptr> struct _Slist_iterator : public _Slist_iterator_base { typedef _Slist_iterator<_Tp, _Tp&, _Tp*> iterator; #1 …

Member Avatar for stereomatching
0
145
Member Avatar for jonnyboy12

Hello Hello Hello. At the moment i am working on contacting my web server through my browser. I have got it working. I can communicate with my web server by typing [url]http://localhost[/url] into my browser. [CODE] // fakewebserver.cpp : Defines the entry point for the console application. // #include "stdafx.h" …

Member Avatar for DeanMSands3
0
241
Member Avatar for alexbnc

Hello, I am going crazy with this application. I am trying to re-size and re-position all the window's controls as I re-size it and I don't get the expected result. I have my application source code here: [URL="http://www.devimperium.info/ResizeTest.zip"]http://www.devimperium.info/ResizeTest.zip[/URL] I create the project with CodeBlocks Please, give it a try and …

Member Avatar for alexbnc
0
91
Member Avatar for jonnyboy12

Hello all. I have made a web server in c++; I am able to type in my browser [url]http://localhost[/url] , this will contact my server and make a connection i can add a variable onto the end separated with a ?. I want to send messages to my web server …

Member Avatar for JorgeM
0
173
Member Avatar for ccoder83

Hi, I have a grid, which contains cells that have several different properties. [CODE]struct fluidProperties1 { float foo; float bar; };[/CODE] and I create the grid as follows using a template [CODE]Grid2D<fluidProperties1> grid1;[/CODE] Now, I want to pass the array formed only by the values of foo, and not by …

Member Avatar for ccoder83
0
827
Member Avatar for Jay22

ok so basically my code is complete but I keep getting an error on one of my brackets and it says I need to put a ' ; ' behind "int LinearSearchArray ( const int list[], int numEless, int value)" and when I do that it brings up more errors. …

Member Avatar for MandrewP
0
165
Member Avatar for sharath_137

Hi, I tried to debug my code using printf statement... But previously it was working and today when i tried the same it was not working.... I tried the properties option and it is all the same as before..can any one help me....

Member Avatar for sharath_137
0
131
Member Avatar for pushpat

Hi folks, I am learning operator overloading concept in c++, wrote sample program to test overloading of unary operator '!' and '-'. Code will work if i use them as friend function but not for member function. Can anybody tell where am i going wrong in function bool operator!(const co_ordi …

Member Avatar for pushpat
0
336
Member Avatar for arubajam

Write a statement that declares and stores the elements of the following array into a vector object: char vowels[5]={'a', 'e', 'i', 'o', 'u'}; I think this is what I need, but I want to verify this. [CODE]char vowels[5]={'a', 'e', 'i', 'o', 'u'}; vector<vowels> vowelsList (vowelsArray, vowelsArray +5);[/CODE]

Member Avatar for subith86
0
177
Member Avatar for Moirke

[code]#include <iostream> #include <vector> using namespace std; char img[30][15]; char x = 'X'; int dotLoc[24][2]; int dotNum = 0; int ret[4]; int curDie = 0; int dieNum = 0; int der = 0; vector<int>* readDice(vector<string>&); int dieDots(int, int); void findDots(); bool adjX(int,int); bool traverse(int,int,int,int); vector<int>* readDice(vector<string>& anImage) { // TODO: …

Member Avatar for Ancient Dragon
0
276
Member Avatar for yongj

I'm trying to learn hash tables as I am hearing that it'll be utilized a lot in the future (advanced programming). My book, however, does not include any lessons on Hash Tables. Any good references for someone trying to learn Hash Tables? Thank you!!

Member Avatar for yongj
0
171
Member Avatar for mc3330418

I tried to write the function myself for a switch statement that would take a char and multiply it by a certain amount and then return the total. I'm a little confused on how the object gets passed to the case function. But here's what I got. [CODE] #include <iostream> …

Member Avatar for WaltP
0
2K
Member Avatar for rekedmc

Hi, I need help with my assignment. Basically I have to make a html page and have the output display in a .cgi file. I am able to change the font and colors in the html page but the output of my cgi file comes out in black font. I …

Member Avatar for WaltP
0
344

The End.