General C++ Programming - November 2011 (Page 37)

by xian
Read and dDisplay file into Array
 
I want to read a text file which consists of N rows and N columns filled with numbers. I will need an array that I can then use in code. Can anyone guide me ...
[1 reply] : Just read the file line by line... convert character to integer and ne... (by richardforc)
Opening A Text File with a variable argument
 
I'd like to take in a string from the user and open a text file based on the user input: Here's What I have: void open(std::vector<std::string> existing_fil...
[1 reply] : why don't you use address.c_str() which returns const char*pointed by ... (by richardforc)
Conversion: char * to char const *&
 
Given a char array "str" and a function "foo" which takes a 'char const *&' argument, is there any better/shorter alternative to the following? foo( *const_...
[14 replies] Last: strlen returns a size_t, which is often unsigned. Actually size_t is... (by Baltram)
Rodent project...I need assistance!
 
Hello all, ***Question: I am having trouble with the random number generator. For week 0, I want to set the starting number of roaches in House A (totalRoa...
[no replies]
Template class
 
I have an assignment where I need to pass three different types to a template class when I try to compile, "pair" is undeclared in int main(). and that also ...
[4 replies] Last: Thank you all, that was just the information I needed. I will have to ... (by mlameyer)
class storage space? need help.
 
hello all. I want to know a couple of things. I want to make an array to save space for a class that I'm making. then I want to instantiate a temp pointer o...
[2 replies] Last: ok, so using my actual code, would it look something like this? ... (by TimothyHTime)
by domaa
delete end function in a single link list
 
I am having issues with trying to delete the information at the end of my list. Here is a list of my code // things needed in this program // link* ad...
[2 replies] Last: Thanks a ton for the reply. I'm kicking myself for not looking at the ... (by domaa)
by S G H
[SOLVED]Bitwise "Or" Question.
 
I'm working on Functions that need "Flags", just like MessageBox. But, Let's assume i call a function like: void Test(DWORD Flags) Let's say i put "MB_OK |...
[5 replies] Last: Perfect, now i have all I was looking for. Thank you! (by S G H)
Compiler error with a push_back()
 
well, i was programing a neural net for some ants in c++, and then when i compiled, the program got stuck in this part of the xmemory code: void construct...
[12 replies] Last: Good point though. if(2 = i) won't compile since 2 is not an lvalue.... (by closed account D80DSL3A)
can't set inline member function
 
hello, please have a look at this: Linija.h #pragma once class Linija { private: int x1, y1, x2, y2; void OdreziTocku(int Linija::* pok1, int Linij...
[4 replies] Last: excelent, tnx for help mate!! :D (by codekiddy)
How to restart the program ?
 
(UPDATED) hey guys this is my code everything is working, but I want to go the extra mile, I would like for my program to restart automatically in case the user...
[4 replies] Last: that worked perfect thanks, I feel bad to ask since you have helped me... (by jonathan flores)
by hass
am really stuck
 
help i am really stuck, need someone to have a look at this , when u look at the 1,Reserve,suppose to ask u if want 1)first class or 2) Economy class, but is...
[1 reply] : In Reserve() you never defined the int i or int j. Just add them to th... (by wolfgang)
by phoemi
No way to have a boolean expression typed once both evaluated and treated as a literal, is there?
 
EDIT 2: NVM, got it. After I posted, I realized I was trying to make my own version of assert, so made my first edit to this post. After doing that, I realize...
[no replies]
Redefinition of Class Error
 
This is an error unfortunately I've not had the joy of debugging before, so I'm not sure what's going on with this one. Here is the list of errors I'm receiving...
[3 replies] Last: @andywestken This cleared it up, thanks! (by aerowenn)
using strcmp
 
pllllllllllzzzzz someone help me out for this plzzzzz...i want to output equal words from words groups n1 and n1. this program just giving value of the equal wo...
[1 reply] : Duplicate thread. http://www.cplusplus.com/forum/beginner/54349/ See r... (by closed account D80DSL3A)
pointer to class members (need advice)
 
hi, I'm learni about pointers to class members and metods and i've stuck on part where members are private: MyClass.h #pragma once class myClass { fri...
[7 replies] Last: heh thanks to all who tryed to help me!! you cant use :: on a privat... (by codekiddy)
Makefile with sub-directories
 
Right now I am doing Object-Oriented-Programming (OOP) in C++, and I am getting to the point where I want each pair of class files (one .h file and one .cpp f...
[7 replies] Last: Here is the final Makefile: # # # # # # # # # # # # # # # # # # # # #... (by matthewmpp)
Loop untill user hits a button
 
When programs execution reaches while(true) loop program goes non-responsive. Any ideas how to fix that? Program was supposed to loop untill user hits escap...
[8 replies] Last: I know this is solved, but if you want to use good practice instead, y... (by BlackSheep)
template problem
 
I have recently installed a template for visual studio 2010 express that didnt work. I have deleted the original files for the template but they still appear un...
[no replies]
Cannot Get this program to stay open in the cmd
 
When I run the code, the ouput does not stay open in the cmd even if I use system("PAUSE"); or ignore. What is going on? #include <iostream> #include ...
[4 replies] Last: Any one? (by closed account 9L8T0pDG)
November 2011 Pages: 1... 3536373839... 47
  Archived months: [oct2011] [dec2011]

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