49,757 Topics

Member Avatar for
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
446
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
80
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
891
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
233
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
820
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
304
Member Avatar for rossie queen

hi everyone, i have a problem in converting the c++ language to c language. can anyone help me to do this because i just learn programming. #include <stdio.h> void choosePlay(char); void playGame(int,int,int,int); void match(int[][4]); int r1,r2,c1,c2; char comma; int cards[4][4]={{1,3,2,4},{4,2,3,1},{5,7,6,8},{8,6,7,5}}; void main() { char click; char newcard; cout<<"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"; cout<<"@ @\n"; …

Member Avatar for gerard4143
0
348
Member Avatar for mayank.dyl
Member Avatar for mayank.dyl
0
109
Member Avatar for RobBobSmith

Hello all, I'm having trouble with making a 2d vector array class. Would anyone have time to help with a couple of questions? I think my problem is with overloading (). I notice that this: [CODE]template <typename T> T& Array2d<T>::operator() ( int x, int y) { if( x >= rows …

Member Avatar for RobBobSmith
0
188
Member Avatar for BigBang5

#include <iostream> #include <cmath> using namespace std; int main () { int numMonths; double balance; double numBalance; float rate; double totDeposited = 0.0 ; double totWithdrawn = 0.0 ; double mthlyInterRate = 0.0; double totInterest = 0.0; cout << " Enter the initial balance ===> "; cin >> balance; cout …

Member Avatar for SgtMe
0
159
Member Avatar for Ace1.0.1.

I just want modify the program below to print + or - minus after the letter grade based on the last digit. [CODE]// Chapter 6 - Exercise 1 // A professor generates letter grades using /* 0 - 60 F 67 - 70 D 71 - 80 C 81 - …

Member Avatar for SgtMe
0
148

The End.