49,761 Topics

Member Avatar for
Member Avatar for aznlitomik3

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 …

Member Avatar for Ancient Dragon
0
142
Member Avatar for Joemeister

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 …

Member Avatar for phfilly
0
100
Member Avatar for qvyhnl

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 …

Member Avatar for Ancient Dragon
0
185
Member Avatar for Christ1m

[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> …

Member Avatar for StuXYZ
0
77
Member Avatar for tKc

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 …

Member Avatar for StuXYZ
0
212
Member Avatar for Acidburn
Member Avatar for phfilly

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!

Member Avatar for phfilly
0
181
Member Avatar for merse

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?

Member Avatar for merse
0
175
Member Avatar for z_a

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 …

Member Avatar for z_a
0
448
Member Avatar for low_coder

hey guys, i need to pass 'this' as the template function parameter.. any help will be appreciated.

Member Avatar for low_coder
0
138
Member Avatar for jawadsatti

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& …

Member Avatar for Nick Evan
0
136
Member Avatar for qvyhnl

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 …

Member Avatar for qvyhnl
0
102
Member Avatar for ntgsx92

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++; …

Member Avatar for ntgsx92
0
99
Member Avatar for Duby

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 …

Member Avatar for Ancient Dragon
0
186
Member Avatar for gizmo7008

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 …

Member Avatar for gizmo7008
0
81
Member Avatar for stereomatching

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 += …

Member Avatar for stereomatching
0
148
Member Avatar for mybluehair

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 …

Member Avatar for Ancient Dragon
0
95
Member Avatar for .:Pudge:.

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 …

Member Avatar for Ancient Dragon
0
179
Member Avatar for gbsn3219

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 …

Member Avatar for gbsn3219
0
159
Member Avatar for simoneaolson

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. …

Member Avatar for ixmike88
0
122
Member Avatar for Nathaniel10

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 …

Member Avatar for Nathaniel10
0
146
Member Avatar for meabed

[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 …

Member Avatar for bangonkali
0
892
Member Avatar for dotnabox

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 …

0
88
Member Avatar for mommabear

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. …

Member Avatar for mommabear
0
237
Member Avatar for Jaily

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 …

Member Avatar for Jaily
0
154
Member Avatar for nickx522
Member Avatar for techfish

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 …

Member Avatar for arkoenig
0
822
Member Avatar for stvnddich

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 …

Member Avatar for stvnddich
0
141
Member Avatar for mmavipc
Member Avatar for Randophera

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. …

Member Avatar for ChrisKelso
0
305

The End.