49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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.. … | |
[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 … | |
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 … | |
/*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; … | |
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" … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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! | |
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 … | |
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" … | |
| 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 … |
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 … | |
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 … | |
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. … | |
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.... | |
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 … | |
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] | |
[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: … | |
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!! | |
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> … | |
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 … |
The End.