49,761 Topics

Member Avatar for
Member Avatar for jeezcak3++

It goes "BLEEP" when one of these strings are input. [CODE]int main() { vector<string> words(); words[0] == "roller coasters"; words[1] == "waiting"; words[2] == "people who talk on the phone while driving"; words[3] == "wars"; string temp; while (cin >> temp) words.push_back(temp); for (int i = 0; i < words.size(); …

Member Avatar for jeezcak3++
0
133
Member Avatar for James19142
Member Avatar for Freaky_Chris

The following code snippet can be used to convert a decimal integer into any base from 2-16. This is a simple piece of code and I hope t proves useful to people. I see many people posting Decimal to Hex. or Decimal to binary, non any better than the next. …

Member Avatar for hehehe01
0
3K
Member Avatar for rhoit

[CODE=cpp]struct Table { char* aTag; char* bTag; }; int main() { Table T1; cout<<T1.aTag; cout<<T1.bTag; return 0; }[/CODE] This might be crazy but... i really need to know is there any way to so that we can only write [CODE=cpp]cout<<aTag cout<<bTag [/CODE]instead of [ICODE]T1.aTag[/ICODE] like we do in [ICODE]namespace [/ICODE] …

Member Avatar for mrnutty
0
261
Member Avatar for tkud

Hello again. Thanks to all that contributed positively to my first thread. it went a long way. Now, i am here again. can someone please help me out in the case of vectors.i.e. [#include<vector>]? Please do not be angry at me for posting such oversimple questions,i am a dumb beginner …

Member Avatar for jeezcak3++
0
112
Member Avatar for osmano807

Hello! Well, I need an alternative to be able to delete files not accessed for more than 5 minutes. I already know how to do this using the system programs, but wanted something done in C++ once, to avoid bottlenecks. Is there any way to do this? (if not understand, …

Member Avatar for osmano807
0
74
Member Avatar for yakovm

Hello I work with g++ on ubuntu 9.04 Here is a code from cpp file: [code]for(subPipelineStrings::iterator pipelineIterator = pipelineRange.first; pipelineIterator != pipelineRange.second;++pipelineIterator) { pair<set<pipeline>::iterator,bool> uniqRes = uniqPipeline.insert(pipelineIterator->second); if(!uniqRes.second) { pipelineIterator = m_subPipelineStrings->erase(pipelineIterator); } } [/code] Here is a declaration .from h file [code]typedef multimap<size_t,pipeline> subPipelineStrings; [/code] I have following error …

0
66
Member Avatar for Striker99

I'm trying to learn C++ on my own so I figured I'd try to write a program for my data communications class. We were learning about hamming codes and I want to try to make a program that will let me do it automatically instead of on paper. I'd take …

0
108
Member Avatar for McCarrell

I am trying to reference a 2d dynamic array which i used pointer to pointers to declare. the constructors run without a problem but as soon as i run another function or an overloaded operator i get errors. Its almost like i am referencing the array in the pointers incorrectly. …

Member Avatar for Agni
0
84
Member Avatar for Ponomous

Hey, So I am trying to get several numbers (below ) to be stored in various variables. Could you look at my code and tell me what I am messing up? (trying to emulate an example from class that I missed, stupid swine flu...)) the numbers (yes there is a …

Member Avatar for Ponomous
0
129
Member Avatar for Darth Vader

I have a file that consists of dates like this: 12/[B]01/[/B]2008 12/[B]02[/B]/2008 12/[B]03[/B]/2008 12/[B]04[/B]/2008 12/[B]05[/B]/2008 Now if I will read this file from beginning to end, this is a solution: [code] String^ FilePath = "C:\\DateFile.txt"; String^ GetLine = ""; StreamReader^ Read = gcnew StreamReader(FilePath); while(Read->Peek() >= 0 ) { GetLine …

Member Avatar for sfuo
0
123
Member Avatar for rhoit

01 Why i am not able to do this [CODE]int* px; px = new int[2][2]; [/CODE] other the [ICODE]px = new int[2*2];[/ICODE] is there any other method 02 Why i am not able do access through pointer dx by [ICODE]dx[1][2][/ICODE] other than by using [ICODE]dx[1*7+2][/ICODE] [CODE=cpp] static float mat[5][7] = …

Member Avatar for Sky Diploma
0
133
Member Avatar for atch

Hi, I'm trying to implement my own allocator using malloc and free. One thing what interests me is that in declaration of deallocate in addition to pointer we have also parameter size which suppose to be size of elements allocated with allocate but having implemented my deallocate as this: [code=c++] …

Member Avatar for atch
0
91
Member Avatar for pztrick

Hi, <--- Newbie I am trying to install the Boost libraries, specifically the Boost filesystem library. Many of the libraries are header-files only. No building. The Filesystem library requires me to build binaries... A new challenge, but I was able to pull it off. However, the binaries are located in …

Member Avatar for micwide
0
133
Member Avatar for stoymigo

Hi , I recently read this on another forum... [Quote] C/C++ are still standards for writing fast, standalone software, so you'll be wanting to work your way there. [/Quote] If I want to develop an application that has many "if statements" and many "loops" , that executes only on the …

Member Avatar for stoymigo
0
163
Member Avatar for NinjaLink

Hello. I'm having a hard time finding which block of code in this program is [B]"insert in the middle"[/B] for Link List, so I can study it. Can someone point out where it is in the program and if insert head code below is included in insert middle. Much appreciate …

Member Avatar for NinjaLink
0
111
Member Avatar for leoni

Hi All! I have a doubt about returning reference. I'll show you an example: [CODE] Vector &MakeVector() { Vector *result = new Vector<Dim>(); /*some more code*/ return *result; } [/CODE] now I can call the function MakeVector to assign it result in this two ways: [CODE] Vector v = MakeVector(); …

Member Avatar for leoni
0
145
Member Avatar for SARPONG

can u please send me a code for implementing a singly linked structure with the class Animal, by defining the ff methods and overloading those necessary opreator*, operator++, operator--;operator++(int), operator!=,push_front,pop_front.tanx

Member Avatar for Dave Sinkula
0
33
Member Avatar for arshad115

Hi,I want to convert String^ to Int array or a char array.I am reading numbers from a file in GUI but the StreamReader Reads the Text in a String.I need to convert them to use the numbers. I have tried ToCharArray() function but it doesnt work! this function gives the …

Member Avatar for arshad115
0
2K
Member Avatar for koban_alche
Member Avatar for Tom Gunn
0
135
Member Avatar for Rabex

can s/o plz give a simple example of how recursion can be used in programming....im new to this topic so i need help i cant develop new codes myself.

Member Avatar for mrnutty
0
198
Member Avatar for csaund1

This program kinda works, but I have one problem. I setup this program to display a message when someone enters a negative number, but I how do I set the count back to zero. Even though mesage prompts the user that a negative number is invalid, it still calculates the …

Member Avatar for Furqanz
0
171
Member Avatar for low1988

[CODE] #include <iostream> #include <conio.h> using namespace std; struct employeeInfo { string name; int id; string department; employeeInfo *next; }; class List { public: List(void) { head = NULL; } // constructor ~List(void); // destructor bool IsEmpty() { return head == NULL; } employeeInfo* InsertEmployee(string ,int ,string ); void DisplayList(void); …

0
64
Member Avatar for loolyn

Hi. I'm trying to use SetBkColor to change the background color of my control. In XP I can see the result, but in Vista no affect, the default backgound color it taken. Any ideas? Thanks.

Member Avatar for William Hemsworth
1
92
Member Avatar for power_computer

I have the following code snippet which is the most important as you can see I have two arrays defined of two different classes, my main agenda is printing them both out in a single list in ascending order based on the .GetDay value in each array, however when read …

0
67
Member Avatar for mz_rigel

I wrote the below code and when I try to compile it I get the following error: error C2109: subscript requires array or pointer type. Can anyone tell me what I did wrong and how I can fix it? Thanks a lot! :) [CODE] // This program writes the bombsweeper …

Member Avatar for kvprajapati
0
100
Member Avatar for Knoxx

this is a c++ program for the simulation of gillians island i did. im a newbie in programming looking to improve on my skills. Can some assist me on how to break this code into functions. please dont rewrite the code i need just a sampler from code i can …

Member Avatar for Knoxx
0
102
Member Avatar for bdub19

Alright, so the assignment which im sure you guys have seen around alot is to do a powerball type program, 1-55 for the first 5 numbers then the 6th 1-42. I set up the program, i get my random numbers. but the teacher wants you to assign a single variable …

Member Avatar for bdub19
0
132
Member Avatar for vileoxidation

Thanks to the help I recieved earlier, I figured out how to make my other header file and my other .cpp file!! So thank you for that. I am now trying to compile all of my files together, and am getting quite a few linker errors, even though the functions …

Member Avatar for vileoxidation
0
218
Member Avatar for power_computer

Wow sorry for so many edits I just need to swap the rest of my array of structs along with the day value now delete this post or post insight on how [code] int x, y; for(x = 0; x < l; x++) { for(y = 0; y < x; …

Member Avatar for Ancient Dragon
-1
73

The End.