49,756 Topics

Member Avatar for
Member Avatar for BlackStar

I'm having a problem with cin.get(). I'm prohibiting the user, that he can only enter 5 keys. and each key does something, like a MENU. Press 1, if you want this, etc. [ICODE]char choice[5]; cout<<"ENTER YOUR CHOICE"<<endl; cin.get( choice, 5); switch (choice)[/ICODE] Okay, when I run this, the compiler gives …

Member Avatar for Narue
0
114
Member Avatar for Clockowl

Hey guys, With this defintion: sss.hpp [code=cpp] #include <fstream> #include <string> #include <map> namespace sss { using namespace std; class node { public: multimap<string, string> values; multimap<string, node> children; string &value(const string name, int index = 0); node &child(const string name, int index = 0); //... }; typedef pair<string, string> …

Member Avatar for ArkM
0
91
Member Avatar for DREAMER546

Hi please can anyone run this code for me in Linux .. i want to know what's the output [CODE=c++] #include <stdio.h> #include <unistd.h> #include <sys/types.h> int main(){ for (i = 0; i < 3; i++) { if (fork() != 0) { printf("ONE"); if (fork() == 0) { printf("TWO"); } …

Member Avatar for Nick Evan
0
145
Member Avatar for vicky_menonsky

hi all, im trying to write contact info(name & number)from a file to the sim, in VC++ for Windows Mobile 6.0..iam unable to do this using the SimWritePhoneBookEntry()...can u guys plzzz suggest an alternative strategy.. thnksss

0
44
Member Avatar for elbashamoe

hey everyone need some help with a little homework assignment i need to make a program where a user is trying to book a seat on an airline in either first class or coach and if the seat that the passenger has choose is taken it either gives him another …

Member Avatar for mvmalderen
0
101
Member Avatar for Psykocyber

Hi I'm having a problem with this piece of inheritance code. When compiling it displays this error " 'getAverage' : is not a member of 'Person' " but shouldn't the casting overcome that problem? Do i really need to have a virtual function in "Person" for this to work? Thanks …

Member Avatar for Psykocyber
0
126
Member Avatar for abhi_elementx

In this code : [CODE] #include <iostream> using namespace std; class Singleton{ private: Singleton(){} public: static Singleton* getInstance(); void myFunction(){ cout<<"\nmyFunction() called.."; } }; Singleton* Singleton :: getInstance(){ static Singleton* obj = NULL; if(obj == NULL){ cout<<"\nCreating new instance..."; obj = new Singleton(); cout<<"\nReturning instance..."; } else{ cout<<"\nan old instance …

Member Avatar for MrSpigot
0
99
Member Avatar for sunshyne23
Member Avatar for ithelp
0
79
Member Avatar for techmaddy

hi, I am using FindFirstFile() and some times it is setting a error code of 317 (ERROR_MR_MID_NOT_FOUND 317 (0x13D)) Can anybody let me know what could be the reasons behind such an error. Thanks in Advance, Madhu

0
41
Member Avatar for harrykokil

hi everyone.. i have a face recognition project to do in any language.. i have no clues on how to begin this.. can anyone plz send me an algorithm on face recognition using neural networks?? thanks

Member Avatar for ithelp
0
108
Member Avatar for burger87

-------------------------------------------------------------------------------- Hey all. I'm a newbie at C++ and hope that you guys can guide me along. I recently got assigned a project and is needed to code it in C++, which I have almost zero experience with, so bear with me. =) I need to delete 3 log files …

Member Avatar for burger87
0
136
Member Avatar for JerryShaw

Hello, I typically hang out in the C# forum, however I hope someone here can help. I am converting a C++ program to C#, and I need to know how to handle a couple things: IOW I know almost nothing about C++, and this code is coming from a non …

Member Avatar for JerryShaw
0
267
Member Avatar for RizzLinux1388

Hi everybody I am working on a String project for my class and I'm stuck on this swap function. This is what my professor has in his "tests" : [CODE]void test_swap_first_shorter() { // Setup fixture string foo("foo"); string barbar("barbar"); // Test foo.swap(barbar); // Verify assert(foo == "barbar"); assert(barbar == "foo"); …

Member Avatar for jephthah
0
199
Member Avatar for trickiscool

I was trying to create a program that simulates tossing a coin to a user specified number of times and then say how many times heads appeared. However when i run my program it only seems to be looping once. [ICODE]//generates a random number 1-10 int rdom_gen() { srand((unsigned)time(0)); int …

Member Avatar for trickiscool
1
178
Member Avatar for aerobama

okay, so I'm a little lost on how to use selection sort and i/o files for this project. the program is supposed to sort a list of first and last names into alphabetical order. here's the catch. each name has a GPA that goes with it. so not only do …

Member Avatar for siddhant3s
0
209
Member Avatar for viki0077

I made this small C++ program, and it won't compile. Please if someone can help me to fix these 2 errors: error C2059: syntax error : ';' error C2059: syntax error : '}' The text is not in english, but it doesn't metter, just these 2 syntax errors so it …

Member Avatar for waldchr
0
165
Member Avatar for ShadowScripter

I stumbled upon another what I think is initializer, like int and char, named [B]HANDLE.[/B] It's also used when creating an application, I've browsed the net and found that it is a sort of pointer to an object that can change without me knowing it... eh... It wasn't really that …

Member Avatar for ShadowScripter
0
102
Member Avatar for southernd0529

[code=cplusplus] #include<iostream> #include<iomanip> #include<fstream> using namespace std; const int N = 20; // file declaration and open ifstream inFile; ofstream outFile; /* need to open files here */ //function prototypes void initialize(int& zeroCount, int& oddCount, int& evenCount); void getNumber(int& num); void classifyNumber(int num, int& zeroCount, int& oddCount, int& evenCount); void …

Member Avatar for jephthah
0
270
Member Avatar for booker

Hello I have a C++ project A which has to use heather/source files of project B. When I do include "B.h" then B's heather can't be seen because B and A are in a different sub-folders of the same folder.What can I do thank you

Member Avatar for booker
0
94
Member Avatar for DaveD3

Hi! I am writting an windows form application in Visual C++ .NET 2003 and have an issue. When a user makes a change in the datagrid, how can I detect that a change has been made eithor with the datagrid or the underlying dataset? Also how can I identify the …

0
53
Member Avatar for sharensla

I have a problem with this code given below when i compile it without pointers it easily runs i want to run it by using pointer it gives me erro can any body runs the programme with pointers. when i compile this without pointer it runs #include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> …

Member Avatar for JugglerDrummer
0
174
Member Avatar for Nickair

Hi i am trying to find a good C++ tutorial to help get me started with programming. Does anyone know of a good one?

Member Avatar for mvmalderen
0
100
Member Avatar for massivefermion

Hi I have two questions? 1-Is the quality of a picture related to its number of pixels?(I know its not related to c++) 2-Is it possible to work with individual pixels of a picture via c++? thanks

Member Avatar for ArkM
0
117
Member Avatar for bolx

Hi there, i have an assignment, and i need to create a monthly expenditure. I have managed to get alot done, a fully functioning menu and all the functions. Im stuck when it comes to deleting an entry I have been using structured arrays to store data, ive posted all …

Member Avatar for bolx
0
139
Member Avatar for viki0077

I'm really a beginner in C++ programming, and the above problem is just a part of c++ excercise. Can somebody give me a tip how to implement this in C++? The biggest problem for me is to implement and write this: • red+yellow light on cat traffic light is 2 …

Member Avatar for mvmalderen
0
8K
Member Avatar for jomacho

Hi, this is my first post here. The fact is i'm not a programmer and i need help. I have a software that i need to solve a vehicle routing problem for my thesis. But i only got the source code for it, one header file and 6 cpp files. …

Member Avatar for mvmalderen
0
124
Member Avatar for leid999

Hi: I have a C++ program in which I generate a window to show my progress. I design that the window will maintain until I click "OK' button on it after all process done. However, it is always automatically shut down before I can see the OK button. I tried …

0
42
Member Avatar for timos

Is it possible to use web browser as GUI for C++? Possibly use Google Chrome as GUI instead of windows API. I would rather stay away from learning the windows API mess. I just need to get some inputs from user, and spit out a picture to the screen and …

Member Avatar for ShawnCplus
0
58
Member Avatar for rock9449

i am a bit confused on how to start this i have to write a for loop to read in 10 number , write bubble sort having 2 nested for loops and writing a loop to output to sorted array [code] int main () { int total_neg=0;// intialize int total_pos=0; …

Member Avatar for WaltP
0
147
Member Avatar for Clockowl

Hey guys, I got this code, and I can't get it to compile, no clue what I'm doing wrong. [code=cpp]#include <iostream> #include <vector> #include <iterator> using namespace std; template <class T> void kill_dupes(vector<T> &x){ vector<T> y; for(vector<T>::iterator it = x.begin(); it != x.end(); it++){ if(find(x.begin(), x.end(), *it) == x.end()){ y.push_back(*it); …

Member Avatar for siddhant3s
0
2K

The End.