General C++ Programming - December 2011 (Page 32)

Problems with ifstream -- reading a textfile, but skipping over next one
 
Here's an excerpt from my code: void SparseMatrix2D::read(std::string filename) { std::ifstream inp, in; in.open(filename.c_str(), std::ios::in); if(i...
[no replies]
SetLocale in C++
 
i have a project in C++ 2005 that requires the session locale to be changed based on the user, e.g. English to German. SetLocale works fine for most languages ...
[5 replies] Last: Just to let everyone know... I posted this also to MSDN forums and ... (by William Ratcliffe)
user defined copy constructor doubt
 
Well, I have understood bit-wise copy very well but still not getting my hands on deep copy. I have understood the mechanism, but not able to implement it in a ...
[7 replies] Last: @gaminic - thanks for the information. It's in <cstring> :) (by incognito)
problem in initializing data members outside main()
 
If the data member of a class is public, isn't it syntactically correct to assign value to it anywhere after the class declaration? I am trying following code....
[3 replies] Last: @bradw and kbw - Oh ! You are right. I was just trying to experiment w... (by incognito)
How to find large consecutive substring from a string.
 
Hi, please tell me how i can find large consecutive substring from a string. For Example: Input is : ABCQWERSTUVWNOL out put should be: RSTUVW
[3 replies] Last: @bradw, he's not looking for a known string, but for a part of alphabe... (by hamsterman)
Armadillo library question (people with knowledge about any other linear algebra c++ package may be able to help)
 
//solves the initial value problem using forward Euler method and outputs the results double* System::ForwardEulerOdeSolve(double tau, double t_0, double t_e)...
[5 replies] Last: There's no such thing as a "temporary memory leak". A memory leak occu... (by helios)
Rainfall
 
Write a modular program that analyzes a year's worth of rainfall data. In addition to main, the program should have a getData function that accepts the total ra...
[3 replies] Last: These linker error messages can be a little difficult to read sometime... (by bradw)
Different words in file
 
I'm creating a function that reads a file of words and adds it into an array of strings. Then I have to remove any word that are duplicates. void diffwords(i...
[18 replies] Last: Ah, I see. I managed to figure out how to work it before you made the ... (by s0u1k33p3r)
How do I get a type(keyword) in a function?
 
Hello all! How do I get a type(keyword) in a function? Here is my program: #include <stdio.h> #include <stdlib.h> #include <typeinfo.h> void test...
[6 replies] Last: Thank for your replies, Peter87 and firedraco !!! (by make026)
Readers and Writers problem
 
Hello, I have a problem making a simulation program for the readers and writers problem, I want to have 1 writer and "n" of readers and I need to be able to se...
[no replies]
LNK2019 and LNK1120
 
Error 1 error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup MSVCRTD.lib assignment Error 2 fatal error LNK1120: 1 unre...
[5 replies] Last: i am using win32 console to program it, how could i solve the problem ... (by emperror123)
copy constructor
 
the program take 2 input, and display the add, minus, and max of the 2 number entered. >>get input >>send values to class >>call friend function (add, minu...
[5 replies] Last: thanks a lot guys!! solved my prob already.. :) (by shdin271)
Help me answer some questions :)
 
Hello again, 1) Explain briefly what the program does. Please see program code below. 2) Make a structure chart for the program code given, . (ILLUSTRATION)...
[1 reply] : Smells like homework/quiz to me. Sorry. Don't do others' homeworks. ... (by webJose)
forward declaration / undefined classes -> errors w/ Pizza Factory
 
I think the problem I'm having is that C++ cannot work with class instances without initializing them in a more explicit way than I am doing, but I'm not sure h...
[1 reply] : Forward declaration is only enough when all you have is pointers or re... (by Peter87)
sdl with xcode 4.2
 
Does anyone know how to setup sdl to use with xcode 4.2? I have a macbook. If It can't be done I am willing to learn the harder opengl
[no replies]
by Hyiero
Refining a Triangle
 
How would I go about refining a triangle? So far this is what my code looks like,not finished by far class point {public: point(){} po...
[no replies]
complex in map?
 
Hi, I am trying to use a map to link strings and complex objects, however i cannot figure out how to pass complex into the declaration of the map. and yes...
[2 replies] Last: well that was easy thanks. i was making way harder than needed (by hypercube1)
cin.ignore, get, cin?
 
Hey I have this: do { cout<<"How many: "; cin.get(); cin>>num; cin.ignore(); }while ((num<1)||(num>3)); The ...
[9 replies] Last: Do not use stdio.h, it is deprecated. <cstdio> is the same but in th... (by LB)
Insert function
 
My professor asked me to revise my program , she wants me to use/insert "functions" :( Can you guys help me insert "functions in my program" here it is ...
[2 replies] Last: you can't void main it must be int (by Aramil of Elixia)
Problem with mutiple inclusions and extern declaration
 
Just wondering is it possible to have two classes include each other where the inclusion guards already put up. For example //extern.h #include "pan...
[2 replies] Last: that works thanks, could have saved me 1 hour if I asked early on this... (by vietory)
December 2011 Pages: 1... 3031323334... 39
  Archived months: [nov2011] [jan2012]

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