49,761 Topics
| |
Hi, I'm having an error when running this program and I don't know what kind of error is it. So hoping someone can help me. Thank You!! Program: The input file is created with positive and negative numbers. When program ask for the input file it should be the same … | |
Hi there everyone!! Struggling a bit with some Linked Lists combined with copy constructors as well as operator overloading. Here is the code of the header (.h) and the implementation file (.C). Hope that you can help! [CODE] /////////////////////////////////////////////////////////// ////////////////// //////////////////// ////////////////// Queue.h //////////////////// ////////////////// //////////////////// /////////////////////////////////////////////////////////// #ifndef QUEUE_H #define … | |
Write the function my_strncpy(). The function has three parameters: a char * dest, a const char * src, and an int max, which represents the maximum size of the destination buffer. Copy the characters in src to dest, but don't copy more than max-1 characters. Make sure you correctly terminate … | |
[CODE] template <class T> class Stack // an abstract stack base class { public: Stack() {} virtual void pop() = 0; // all pure virtual T top() const = 0; virtual void push(const T& t) = 0; virtual unsigned int size() const = 0; }; [/CODE] [CODE] template <class T> … | |
I have an issues with my int array, i have a game where its like a mega version of Tic Tac Toe where you need 5 to win instead of 3 and i have tried to come up with a system of checking for a winner or not (right now … | |
Can anyone expand on why you get this error? | |
Hi Everyone I'm busy preparing for my programming examination and I would really appreciate it if someone could just give me some references(websites) to some c++ programming exercises. I believe the best way to prepare for this kind of examination is to practice writing code and understanding it. Thanks! | |
numeric_limits<double>::epsilon() gives the error of (double)1.0 in the sense that 1+epsilon is the next double value which is represented. But how can we calculate the error of arbitrary double number? | |
While reading Stroustrup's "The C++ programming language", I was puzzled at 'declaring a pointer to an array of character strings and declaring a reference to an array of 10 integers', and I had to clear my mind on pointers to arrays. I am posting here the notes I made to … | |
hey guys, i need to pass 'this' as the template function parameter.. any help will be appreciated. | |
plz mention me the errors i dont understand what i do.. [CODE]#include<fstream> #include<iostream> #include<string> #include<ctype.h> #define _TABSIZE 4 using namespace std; int tabsize = _TABSIZE; class token { public: token() : _what(code) {} public: enum type {code, comment, pp, keyword}; string _str; type _what; friend istream& operator>>(istream&, token&); friend ostream& … | |
Write the function my_strrchr(). The function has two parameters: a const char * s pointing to the first character in a C-style string, and a char, c. Return a pointer to the last appearance of c appearing inside s and NULL (0) if c does not appear inside s. is … | |
I want to write a code that sort a cstring and put all the correct character into a new cstring, Here is my Code. [CODE] #include<iostream> #include<cstring> #include<cctype> using namespace std; int main() { char array[200]={"How Are U?"}; char array1[200]; int n=0; for(int i=0;array[i]!='\0';i++) { if(islower(array[i])||array[i]==' ') { strcpy(array1[n],array[i]); n++; … | |
Please be patient with me for this is my time posting and I am still in the primitive stages of programming. I am using C++ VS. Thus far, the code I have written will prompt for a users first name, last name and telephone number(without dashes or parenthesis). The output … | |
I'm trying to get what I put in the value for the database to output, however whenever I use a cout statement with the a.name I get an error on line 21 which is the line with the cout statement. I've done it the way it is in the examples … | |
Below is my code [code] string str2 = "1, 2, 3, 4, 5, 6, 7, 8"; string output; typedef std::tr1::sregex_token_iterator sti; const sti end; for(sti i(str2.begin(), str2.end(), regex(",\\s"), -1); i != end; ++i) { //output += "\"" + *i + "\", "; output += "\""; output += *i; output += … | |
I have a script that is using the internet protocol 'Curl' I am sending a http _POST to a php file. To send a post with curl, I need to make a char variable with all my info. for example "name=andrew&country=usa" Here is where the problem comes in - One … | |
I get the error " no match for 'operator=' in '* n->node::child = root' in the "insert" method and I don't know how to fix it. I know it has something to do with pointers and the way I initialized the array. What I want to do is is put … | |
Hello. I am relatively new to C++ programming, and I have a question about a program that I am supposed to write. The assignment reads... Prompt the user for a word; call it SEARCH. Then begin reading words from the user, counting them until SEARCH is entered. Display how many … | |
I am proficient in c++, however i know almost nothing regarding the windows api. What i want my program to do is intercept the CAPSLOCK key and ignore it (as if it weren't pressed in the first place) If the user presses SHIFT+CAPSLOCK it would toggle capslock on or off. … | |
I have made revisions to my program. I gave up on the idea of using functions that return arrays. That was far too complicated for the expected benefit. This latest version compiles and runs correctly with all of the provisions required by the exercise. What remains is feedback on the … | |
[edit] This code was originally posted [URL="http://www.programmersheaven.com/dow...3/ZipView.aspx"]here [/URL][/edit] The problem is to find all ways of placing n non-taking queens on a n by n board. A queen attacks all cells in its same row, column, and either diagonal. Therefore, the objective is to place n queens on an n … | |
Hey everyone. So I'm stuck trying to insert a class object into my List. I'll try to post what I think is code relevant to my question, but can post more if needed. Basically, I want to have an adjacency list that holds the adjNodes, which contain the weight and … | |
I'm getting a few error codes on this part of my lab. I showed it to another colleague and he said that it should work as written. Maybe one of you can see the error that I'm missing. I'd love to be done with it and get it turned in. … | |
I'm trying to input numbers in a binary tree with an array of random integers. But all I get is two numbers, and they are always the same! From the main: [CODE] const int length= 10; // This is used several places, hence the const int array[length]; // One of … | |
I get a Segmentation fault error and I cant find what's wrong with the program. programs fails when it tries to execute this line "delete [] this->courseList" in operator = overloading function. [CODE=c] #include <iostream> #include <string> using namespace std; class Student{ private: //A string that stores the name of … | |
I need to write a program that generates a magic square of an odd number between 3 and 15. I have written out this much code, and when i type in 3 for the number it gives me the correct square. but any other odd number it gives me an … | |
| |
Hi, I'm kinda new here, and I've only been programming for 6 or 8 months, so please forgive me if I sound like a total noob or an idiot with programming. I've been trying to code for my school assignment two AIs that are supposed to navigate around a maze. … |
The End.