49,761 Topics
| |
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 … | |
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 … | |
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, … | |
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 << … | |
[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 … | |
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 … | |
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: | |
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 … | |
[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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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); … | |
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 … | |
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 … | |
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 … | |
| 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 … |
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 … | |
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 … | |
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 … | |
Please, any one help me to write a c++ program which display its source code??? | |
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 … | |
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. … | |
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 … |
The End.