General C++ Programming - February 2010 (Page 19)

What's wrong with my code?
 
#include <iostream> #include <vector> using namespace std; bool LinearSearch( vector<int> data, int searchTerm ) { int index, no, yes; no = false; ...
[1 reply] : It doesn't compile. vector<int> myvec = ( 1, 2, 3, 4 ); Th... (by jsmith)
Looking for some c++ definitions (1,2)
 
Hey im a student in Highschool learning c++. Im wondering if anyone can help me out with some c++ definitions cause I cant seem to find them anywhere on the net...
[20 replies] Last: try this. http://www.webopedia.com/Programming/ (by blackcoder41)
question about file input
 
I am reading some number matrix from a text file . I had two pieces of code 1: ifstream ifs; //open file while(!ifs.eof()){ //getline & other stuff } 2...
[4 replies] Last: another reason is maybe because he is using binary mode.. ios::binary... (by blackcoder41)
Converting arrays to bitsets
 
Hi I have been trying to write a code that does the following: The idea is to convert a series of numbers (stored in r) ranging from 0 to 4 into a bitset ...
[7 replies] Last: Just guessing that you are walking off the end of an array somewhere. ... (by jsmith)
by JLEE
encapsulation problems :)
 
Here we go. I got this: class Expression { public: Expression(void); ~Expression(void); . . . private: }; class Function : public Expression { ...
[2 replies] Last: Non sequitur. You need to post your code and the compile error. (by jsmith)
Virtual inheritance and constructors
 
I've been programming "C in C++" for around 10 years, mainly using classes for religious data encapsulation, and have been mucking around with virtual functions...
[6 replies] Last: I think there have been some details left out in the answer. Read h... (by jsmith)
template C++ class to simulate java interface?
 
I have such a template class template <class T> class foo{ // some stuff here }; How do I make sure that class T has some methods? For example T has to be ...
[6 replies] Last: Well... just because they are interviewing you doesn't mean they are a... (by jsmith)
using multiple new() statement on same pointer
 
I am curious about the new operator. if i have the statements int *p = new int(4); p = new int(3); What happens in the memory? Does the memory for ...
[5 replies] Last: ...which is about the same thing. Modern OSs recognize this kind of... (by Duthomhas)
app without main()
 
Hi all, How can programs entry point be changed? For example, windows api uses WinMain as an entry point instead of main and sdl uses sdl_main. Is there some...
[8 replies] Last: Don't do that! I wasn't going to... I just wanted to know, how is ... (by hamsterman)
by JLEE
missing ';' before identifier 'f'
 
Hi i got this problem: class Expression { public: Expression(void); ~Expression(void); . . . private: Function f; }; class Function : public ...
[4 replies] Last: Thanks you guys. I also thought that was the problem but i wanted to a... (by JLEE)
Good websites with sample programming questions and their solutions?
 
I'm trying to find some good websites with questions such as "Create a program that does blah blah.." And then gives the solutions so I can program and then ...
[2 replies] Last: http://www.reddit.com/r/carlhprogramming/ (by Mythios)
MinGW custom codecvt facet VTABLE error
 
Hey gurus, I've finally found the little beast I've been looking for to play with UTF conversions: the std :: codecvt facets. I've written a custom temp...
[13 replies] Last: Well, this is what I have learned. The codecvt facet can be mod... (by Duthomhas)
moving functions from header to imp file..overloaded op
 
Hi I am trying to take a large code that has all its functions written in the header file, and im trying to move them to the implementation file. Theres an ove...
[4 replies] Last: Very basically, it's a two step process: 1) Compiling takes all ... (by Disch)
by atchon
getline confusion
 
I am writing a quick little program to read in a file with DNA sequence and then just output just the DNA. I can get it to output the DNA how I want, but I want...
[3 replies] Last: nevermind I got it there were spaces on the line so it wasn't seeing i... (by atchon)
C++ Character Histogram
 
I've written a code to make a character histogram of a sentence that is entered. However, i'm trying to make it so I can select the character to show the histo...
[no replies]
by ramsci
c++ memcpy string to char*
 
Hello, I have a string that contains null characters in the middle. I am trying to convert it to a char *. I am new to c++ and I see that using c_str for exa...
[10 replies] Last: Exactly. (by Disch)
by Artur
diff. between template<class T,class U> & template<class T>template<class U>
 
Hi all; Can u give an example please to represent the difference between template <class T,class U> //some function or class and templat...
[1 reply] : Example 1; This is an illegal declaration - you cannot declare the ... (by guestgulkan)
by fzuend
Polymorphism and virtual setters
 
Hi, I'm new to c++ (but I know other languages) and I'm confused about how to implement something. I hope one of you can solve this (probably very simple) pr...
[7 replies] Last: The solution I was initially looking for was generics ! Something... (by fzuend)
cin wont work.
 
I use Netbeans 6.7.1 in ubuntu 9.1 My code is below... I don't understand why cin doesn't stop for input... /* * File: main.cpp * Author: joshua ...
[2 replies] Last: It is just meant to rec a character name for now. The line I am having... (by jfarr1978)
Team
 
Hello, im about to start up a new "team". offcorse its a c++ team. the idia is to collect some good programmers, and then create some cool programs together....
[12 replies] Last: @ pangalatic. it dosn't pay anything. ____________________________... (by Lund259)
February 2010 Pages: 1... 1718192021
  Archived months: [jan2010] [mar2010]

This is an archived page. To post a new message, go to the current page.