51,593 Topics
![]() | |
Hi , I am stuck with my this bank account programming. The question is like this: Create a base class Bank of a bank account with member functions to allow withdrawal, deposit and calculation of balance. Account should have a name, account number and type. Create derived class Saving of … | |
Hello I am new to this forum and was wondering if someone could give me advice regarding a good compiler to continue learning C++. I took a C++ course but used the gcc compiler in the labs, now that I got my laptop, I don't know where to start. Thanks … | |
Okay here is some code I have made: [code] /*============================================= Number Guessing Game Uses the srand() function and loops. James Duncan Bennet - james.bennet1@ntlworld.com ===========================================*/ #include <iostream> #include <cstdlib> #include <ctime> #include <fstream> #include <string> using namespace std; int guess = 0; int tries = 0; string line; int main() … | |
I am working on a project and I need to process a text file. I have read in the text file. What I want to do is break the textfile up. The textfile looks like this: >Name 1 ABCDEF GHIJKLM >Name2 GHIJKLM What I want is to store each name … | |
I'm writing a doubly linked list and a lot of the code ends up being the same with _next and _prev switched. What can I do to keep from writing some code with _next and then the same code again with _prev? Can I do like a template that flips … | |
Hi, I am new in programming. I would appreciate if anyone can help me out to find maximum value of each column in the following matrix. int array[3][5]={{1,2,30,4,5},{3,41,5,6,7},{5,6,7,81,9}}; Thanks, Vishowntar | |
Hello to all there I m new to this forum and couldnt find the answer to my question so I am creating new thread for discussion on this topic. Recently I have taken some tests and one of many confusing question was this: "Maximum possible number of nodes in a … | |
Program to demonstrate the Stack class #include <iostream> #include <vector> using namespace std; template<class T> class Stack { public: Stack(); bool empty() const; T top() const; T pop(); void push(T element); void Output(T element); private: vector <T> pool; }; //constructor template<class T> Stack<T>::Stack() { pool.reserve(10); } //function to output the … | |
Hi, I need to have my compiler take preprocessor definitions from the command line. How does it differ from normal command line parameter passing (main(int arc, char *argv[])) ? Thanks. | |
-------------------------------------------------------------------------------- When using this with the DrawText API, I make the rectangle that the text is contained in the width of the return value of GetTextExtentPoint32 I know I am using the right parameters, but sometimes the rectangle is way too big (over 15 pixels wider than the actual width … | |
I am making a program where the user has to input text, and the program outputs the appropriate string. I made this program using if else statement, but professor said not to use if and else. So I want to know if I can use the switch statement. I know … | |
Hi guys where is the problem with that simple class program: #include<iostream> #include<conio.h> using namespace std; class DayOfYear { public: DayOfYear(int month,int day); void output(); void input(); private: int month_year; int day_year; }; DayOfYear::DayOfYear(int month,int day) { month_year=month; day_year=day; } void DayOfYear::output() { cout<<month_year<<"/"<<day_year; } void DayOfYear::input() { cout<<"What's your … | |
Hi All, I want to convert char * to int. Plz help me out. Thanks in advance. | |
Hello All, I am writing a program to act as a cash register. I reads in from a file that looks like this: A Cheeseburger 2.97 B Soda 1.90 C Sundae 3.50 ...and so on..... The point is for the user to enter a single letter and then the item … | |
Hello, Could anybody please advise me where I can find examples of high precision floating operators, where I can clearly see the binary schifts. I've learned binary basics, but I have no idea how to write this High Precision Floating operators. (+,-,*,/,etc). I downloaded GMP library, but it didn't have … | |
Hi. I need help please on how to convert an array of WideString values to THashString types. I have an array that needs to be added to a THashStringList object. Can someone please help me? | |
I was told not to have global variables and given an example. Ifollowed it and now I get this error:[B]only const static integral data members can be initialized inside a class or struct on lines 50-85 [/B] [code]#define STRICT #define ORBITER_MODULE #define ENG 1 #define START 2 #define STOP 3 … | |
Dear Friend, How to convert these codes into VB .NET ? Tks, hendy =============================== [code=C++] BYTE cmd[NumMsg][7]={{0x00,0xA4,0x00,0x00,0x02,0x02,0x47}, {0x00,0xA4,0x02,0x00,0x02,0x01,0x02}, {0x00,0xB0,0x00,0x00,0xff,0x00,0x00}}; BYTE DataLength, pData[10], ResponseDataLength; BYTE pResponseData[100]; INT16 TimeOut=50, i, CardFrameSize; char pdata[500]; char *ATS_ATQB; CardFrameSize=0; pdata[0]='\0'; ResponseDataLength=0; if (PICC_RATS(rHandle, 4, &ResponseDataLength, pResponseData)>=0) { CardFrameSize=pResponseData[1]&0x0f; } for (i=0; i<ResponseDataLength; i++) { StrMsg.Format(" … | |
hi any idea about this error. [code] In constructor `local_ExtraLogStreamBuf::local_ExtraLogStreamBuf()': .cc:224: error: `setb' undeclared (first use this function) .cc:224: error: (Each undeclared identifier is reported only once for each function it appears in.) /usr/include/time.h: In member function `void local_ExtraLogStreamBuf::printAtLogLevel(char, const char*)': /usr/include/time.h:250: error: too many arguments to function `char* asctime_r(const … | |
hello there, do anybody here have an idea of the Linux version of the GetTickCount() function. thanks! :) | |
I have a string grid that I am setting the number of rows dynamically. Therefore I am creating an array of TUpDown arrows dynamically and placing one in each cell within a column. My problem is that I want each UpDown arrow to have the same event handler. I can … | |
Hi What is wrong with that piece of code.Why it doeasn't let me compile. It gives me that errors on Dev-C++ : 15 expected primary-expression before "void" 15 ISO C++ forbids declaration of `privite' with no type 15 expected `;' before "void" In member function `void DayOfYear::input()': 45 `check_date' undeclared … | |
Hello once again . My teacher has given us the assignment to enter a string a [B]maximum of 7 charecters[/B] and permute it. Then print all of possible permutations . Like if the inputted word is JAY so Output would be JAY AJY AYJ JYA YAJ YJA I do not … | |
Hello! I need to invert a 24-bit bmp image from right to left, and from top to bottom. I know how to invert colours, but not the position. I only know fstream to open and close files. This is what I did (below). Please let me know where I am … | |
Hi, Is any one using an ASN1 PER encoder/decode in C++ ? i am using esnacc v1.7 to encode ASN1 defined data into C++ objects but i am having problems with the esnacc PER encoding functions, has anyone tested esnacc 1.7 or another tool for PER C++? | |
Hi Guys.. Plz let me know where can i get STL string user guide. and d also if u guys can help me. I want to know is there any method in std::string which can help me convert Lower caase to upper case and vice verssa. Plz help me out … | |
[code=cplusplus] #include <iostream.h> #include <string.h> int const MaxSize = 50; Class CString { public: CString ( ); //Constructor initializes array to NULL. int GetStrLen( ); //Gets the length of the string. void ClearStr( ); //Clears the array to NULL. void DisplayStr( ); //Displays the string as written. void SetStrVal(char*); //Assigns … | |
Suppose while converting RWCString constructors to std::string constructors, i am getting following errors. Can anyone please povide me with the Porting Guide for this .error which i am getting : [code] Hash.h:23: error: 'const struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >' has no member named 'hash' COArgs.cc: In member function `void COArgs::readStream(std::istream&)': … | |
How may I clear whole array in that example? [code=cplusplus] #include <iostream.h> #include <string.h> #include<conio.h> using namespace std; class C_String { public: char* Input(); void Output( ); private: char array[30]; }; char* C_String::Input() { cin.getline(array,30); } void C_String::Output() { cout<<array; } int main() { C_String some_data; char array[30]; cout<<"enter sopme … | |
hello there, can anyone here explain to me and an explanation on the usage of these operators (<< and >>) or point me to any site that explains it very well... thank you... :) | |
Look at that code How may I aproach that. I would like to print the middle charactert of the string, if the string has an even number character ,I would like to print the right most character on the left half of the string thanks [code=cplusplus] #include<iostream> #include<conio.h> using namespace … | |
Hi all, I'm really new to programming, but i understand many basics... I have tried to set myself a goal of creating a "smartbot" that can hold a somewhat intelligent conversation with someone. So far, i can get the bot to recognise a name of a person. I've been trying … | |
Hi Given 4 contiguous bites, how the computer know if that is an ASCII character or integer value? Thanks | |
On my forum I go to we were talking about how some peoples C++ hellowords were 10x larger than the C version.On my GCC and G++ there is no difference but on some of theirs there is a huge one.If any of you wouldn't mind could you compile C [code= … | |
This is probably really easy question. How may I find in C++ if the number is even or odd? Thanks | |
Do all the protected members of super class are inherited to the sub class when we are deriving it in public visible mode or are there any exceptions. | |
char MiddleCharacter( ); //Returns the "middle" character of the //string. If the string length is even //then the right-most character of the //"left" half is returned. how to find the middle character in a string Thank you | |
Hi , i made in my project a new project , a setup project , i add the latest primary output , and have a installation folder , yet when i try to run the release , i get an error ... Unrecoverable build error . anyone ? thanks in … | |
Let's pretend that I'm interviewing you for a C++ job. I want to know how you[1] approach problems and the extent of your C++ prowess, so I'm going to ask you to solve short problems in C++[2]. These problems range from beginner to advanced, and may be more than they … | |
The copyList function here is not working working. Anyone have any ideas? // header file [CODE] #ifndef H_orderedLinkedList #define H_orderedLinkedList #include <list> #include <iostream> using namespace std; struct coordinates { int xValue; //variable to hold x coordinate int yValue; //variable to hold y coordinate }; struct node { coordinates info; … | |
Hi I have an application built in Excel which transfers arrays of data to S-Plus for manipulation and calculations and fetches results from S-Plus and displays them in Excel. It uses COM communication to link excel to S-Plus, however this can be quite slow as the arrays I pass have … | |
any 1 can help put on this..?i cant determine who is the winner when 3 x or 3 0 meet.. /* Tic-Tac-Toe This program will allow 2 players to play a game of tic-tac-toe. Input: Interactive keyboard input from the players. Output: The tic-tac-toe board */ #include <iostream> #include <iomanip> … | |
I am planning to develop a windows application based on XML in C programming..So i need some good reference links regarding which parser to use?and tutorials for those parsers?..also any special preparation is needed in C to achieve this?..Just to mention i am very good in C and a Learner … | |
i wanaa make games in c++ plz give me some advice on how to proceed eg:- i want to make tic tac toe but ant make out the logic plz tell me how to proceed | |
------ Build started: Project: Login Server, Configuration: Debug Win32 ------ Compiling... isc_server.cpp login_client.cpp login_server.cpp main.cpp base_client.cpp base_server.cpp base_socket.cpp crypt.cpp crypt_server.cpp globals.cpp logging.cpp thread_manager.cpp Generating Code... Linking... LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc80-mt-gd-1_34.lib' Build log was saved at "file://c:\Documents and Settings\Matt\Desktop\eROSE2\Login Server\Debug\BuildLog.htm" Login Server - 1 error(s), 0 … | |
Hi, I am working on a program for an assignment. It is to find all the anagrams contained in an input file. I have read the file into a vector. Next I created a 2D array that contains the orginal words from the file in 1 column and the signatures … ![]() | |
Hello all, my name is alfredo, and I am 13 years old. I just started learning c++ about 2 weeks ago, and I am having a problem that's really giving me a headache. I am trying to code a project that will contain 2 files, file1 and file2. When file1 … | |
Is there a way to pass a function template to another function? I tried this but it doesn't work. [code=cplusplus] template <typename T> void template_function( T arg ) { } void function( template <typename T> void (*func)( T arg ) ) { } [/code] How can I pass a function … | |
Hi. I have a C++ program (written In Borland C++ Builder) which makes requests and receives responses via SOAP. I have imported the SOAP using wsdl inporter. It has created the classes and I have created object instances from them. However, I have a particular element that has unboundd values. … | |
when i compiled my c++ code in linux platform (ubuntu), i got an error regarding with an array. the error states: array must be initialized with a brace-enclosed initializer. //source error long long byParam[2] = ""; can anybody show me a solution on my error...thanks |
The End.