49,761 Topics

Member Avatar for
Member Avatar for hybrid87

I get this error message while I'm trying to use copy constructor, I understand why the error message is showing but I don't know how to resolve it. #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <string> #include <ctime> #include <cmath> #include <vector> #include <cassert> using namespace std; class …

Member Avatar for Freaky_Chris
0
189
Member Avatar for iansane

Hi, I have read about using sprintf and tried it but can't make sense of how it works. I have a double with the value 16.525 . I want to cout only 16.53 I also tried setprecision() and it just cuts off the 5 on the end which won't display …

Member Avatar for vmanes
0
747
Member Avatar for axfv

I'm trying to get info about users in Active Directory using C++. In particular, I'd like to retrieve the EmployeeID property, but it doesn't seem to work. I know for sure one user has a value for the EmployeeID. If I look for FullName or LastLogin, I get the values, …

Member Avatar for axfv
0
176
Member Avatar for En-Motion

I'm trying some code with classes but get these errors: overloaded member function not found in 'Point' 'Point' : no appropriate default constructor available [CODE]#include <iostream> using namespace std; class Point { public: Point(float f_x, float f_y, float f_z); private: float x, y, z; protected: }; Point::Point() { cout << …

Member Avatar for En-Motion
0
1K
Member Avatar for vivekc++

[code=cplusplus] #include<iostream> #include<list> using namespace std; int main() { list<int> dob; for(int i=0;i<5;i++) { dob.push_back(i); } for(int i=0,list<int>::iterator itr=dob.begin();i<3;itr++,i++) cout<<*itr; return 0; } [/code] errors-- test.cpp: In function `int main ()': test.cpp:17: `iterator' specified as declarator-id test.cpp:17: extraneous `int' ignored test.cpp:17: `int list<int, allocator<int> >::iterator' is not a static member …

Member Avatar for Ancient Dragon
0
172
Member Avatar for msalman

Hey everyone, I'm very new to c++ and need some help with overloading operator= for a polynomial class. Here's my relevant code: [CODE] // i can't change the method signature as it is required this way polynomial& polynomial::operator =(const polynomial& rtSide) { this->nullify(); // a method to reset variables polynomial …

Member Avatar for StuXYZ
0
423
Member Avatar for ace_man

As I know Radix sort is ideal for numbers but does radix sort applicable for sorting words also?:S,can you give me small ideas how to do that? :icon_confused:

Member Avatar for Ancient Dragon
0
60
Member Avatar for zgulser

Hi, I have class X and class Y such as the following; [code] class X { ... void foo(); ... } ----------------------------------------------- #include "X.h" class Y { void hoo() { X myNewX; myNewX.foo(); } } int main() { X newX = new X(); } [/code] When I do this, it …

Member Avatar for Ancient Dragon
0
118
Member Avatar for Jayrrus

[CODE] this is my program could somebody help plz #include <iostream.h> #include <string> using namespace std; typedef int ComponentType; struct CropType { string crop; string farmer; string color; }; CropType myCrop; struct TreeNode { CropType info; TreeNode* left; TreeNode* right; }; void Insert ( /* in */ ComponentType item); void …

Member Avatar for ArkM
0
133
Member Avatar for pspwxp fan

Hey wizeguys, I am using windows XP and have VC++ 2008. I can make a simple GUI window and write text and add menus and all that n00bish crap. I want to move further. Firstly, i atleast want to know how to change the color of the text that we …

Member Avatar for William Hemsworth
0
188
Member Avatar for kux

ok, so visual C++ is not C99 compliant, but I was wondering how can I access fixed bit length integer types as the one defined in stdint.h (intN_t). thx in advance

Member Avatar for ArkM
0
115
Member Avatar for gkarima

Hi everybody I have a probleme with my console programe So, I have a void in My DLL , [CODE]void Mytest (LPCSTR files, int* erreur) { ..... ...... }[/CODE] Now I Import this function in my console Programe [CODE]extern "C" __declspec(dllimport) void Mytest (string files, int* erreur)[/CODE] but when i …

Member Avatar for nmaillet
0
153
Member Avatar for theighost

Hello, I am to draw a cylinder, so I thought I should start learning to draw an ellipse first, can anyone please help me with the algoritm at least, or if you have an explained code I would be grateful. BTW i am using borland C++ for dos version 3.1 …

Member Avatar for theighost
0
81
Member Avatar for Marcel91

Hey, What i'm trying to do is to use the string.find command with a pointer. Here is the code that i've written sofar. [code] #include <iostream> #include <string> using namespace std; int main() { string one[3]; string two[3]; string searchalt; string *point; int search[3]; int a = 0; size_t found; …

Member Avatar for kbshibukumar
0
102
Member Avatar for Mike Savino

so, to be honest, I'm a student at drexel. I have a comp sci problem. My program works fine except for: [code] if (stuAns[i]!="A" || stuAns[i] !="B") { i--; cout<< "Your answer must be capital A or capital B"<<endl; } [/code] this is embedded in a for loop. Also, it …

Member Avatar for kbshibukumar
0
68
Member Avatar for ryan858

Hey, thanks in advance for any help! I need to search a file for a specific word starting on a newline then skip a SPACE and read the next word into a char array or string, and then skip a word and read the next word, stopping at the next …

Member Avatar for ryan858
0
95
Member Avatar for delerium12345

Your country is at war and your enemies are using a secret code to communicate with each other. you have managed to intercept a message that reads as follows: :mmZ\dxZmx]Zpgy The message is obviously encrypted using the enemy's secret code. You have just learned that their encryption method is based …

Member Avatar for subtercosm
0
916
Member Avatar for kiong

can anyone help me write the code for the below situation using c-string? i'm cracking my head wif tis..... title: Word Processor Write a program to perform the following 3 functionalitiees. 1.Function to replace a misspelled word with a correct one. the keyboard input specification are: --the name of the …

Member Avatar for kiong
0
233
Member Avatar for atman

[CODE] #include<stdio.h> class q1 { int id; public: q1() { id = 1; printf("mkdef: %d\n", id); } q1(int start) { id = start + 1; printf("mknew: %d\n", id); } ~q1() { printf("rm: %d\n", id); } int something(int n) { printf("La-de-da:%d\n", id); return n*(id+3);} }; void foo(void) { q1 one(1); one.something(4); …

Member Avatar for Lerner
0
123
Member Avatar for kotkata

I keep getting this error for the Pet read function: no match for 'operator>>' in 'fin >> ((Pet*)this)->Pet::age' whenever trying to compile the class. I have not implemented anything into main, but I am trying to figure out how to fix this problem so I can go on. Any help …

Member Avatar for Lerner
0
102
Member Avatar for sidrah

Hye........ plzzz solve my problem my problem is that in this progamme is runing but i dont understand that how in the end of the programme there is some thinds are missing that are when programme finished then it print the Thanks for using the program. and this progamme is …

Member Avatar for Mike Savino
0
149
Member Avatar for tedobg

Firs of all hello guys.And then straight to the point :) Ok so my trouble is with creating a password function that will display '*' instead of normal chars.So here is my code: [code=language] string EnterPass() { string Pass=""; char ch=getch(); while (ch != '\r') { if(ch=='\b') cout<<'\b'<<' '<<'\b'; else …

Member Avatar for trapkat20
-1
157
Member Avatar for flip.phinoi

Hello guys, I'm new here and hoping to get some kind of help with my code. This code is to calculate sales tax for specific store. I've got the most part of the code working, but I have to modify it so that it continues to loop until the user …

Member Avatar for WaltP
0
261
Member Avatar for redhotspike

Hey there. I am taking a programming class using C++ and my assignment is to create "Tictactoe" using ObjectOrientedProgramming... The problem is I have no idea what I am doing... I need to have a "tictactoe" class file and a "player" class file - each with their own header files …

Member Avatar for VernonDozier
0
3K
Member Avatar for amerninja2

So in C++, using Something like Unix Sockets or Winsock with C++ lets you use things like TCP/IP. But it only lets you connect to an IP within your router when its by itself. How can I have the program somehow forward the connection to like an HTTP server or …

Member Avatar for amerninja2
0
1K
Member Avatar for coveredinflies

Hi, I am sure this question must have been asked before but I can't find it anyway. I have initialised an array of strings [CODE]char names[][90][/CODE] I don't understand why [CODE]char names[2] = "Bert" [/CODE] doesn't work (incompatible assignment error), even so I have tried [code] dir[2][90] = "Bert" and …

Member Avatar for nmaillet
0
102
Member Avatar for bubun1979
Member Avatar for ArkM
0
194
Member Avatar for Jiropole

Hello, I'm new to Mac development, and for my first project stuck with Objective C only. In the interest of creating portable code, I'm now building non-GUI elements as C++ classes, which has gone alright but now I'm trying to compile a large, existing C++ library (STK audio kit) and …

0
44
Member Avatar for jladd5

Okay, so I am having a few problems with my computer science lab. Below is what I have so far. I am almost positive that the equations are correct, but for some reason I keep getting a different answer than the cs labs example program. So obviously something is wrong. …

Member Avatar for StuXYZ
0
259
Member Avatar for h3llpunk

Hi, Is there a way to stop the user from rezising to window ; so the user won't be able to make the window any bigger or smaller just the size i give to the window. I tried looking it up on this forum and MSDN , but MSDN is …

Member Avatar for h3llpunk
0
92

The End.