Beginners - September 2012 (Page 10)

how can i delete the vector of outer loop inside inner loop
 
I need to delete the vector of outer loop inside the inner loop. for( std::vector<string>::iterator iter4 = LogList.begin(); iter4 != LogList.end(); ++iter4 ...
[1 reply] : It should be LogList.erase(iter4); , but be careful because this will... (by Peter87)
by jPytlo
Ordered linked lists with classes help!
 
Hello there! Im having trouble with creating an ordered linked list with C++ using classes (NOT STRUCTS!!!!!!!!!!!!!!!!!!!!) I have previously done this bef...
[1 reply] : Firstly, this should be before your if statement: newNode->SetData... (by JellyFox)
vector inside vector
 
Hy guys, I have an array size 0 to 180 . I gotdistance of each element to the next element . now what i want is to have an vector array . and on each vector a...
[9 replies] Last: The first erase() should work. The problem are the subsequent erase().... (by coder777)
Replace '\' with '/' in c++
 
Hi, How can i replace the all the occurrence of '\' character with '/' in a string. if i give like, url.replace(url.begin() , url.end() , '\' , '/' ); its ...
[1 reply] : You can't write '\' - the backslash indicates an escape sequence, not ... (by JellyFox)
Bioinformatics program with useless code
 
I wrote this program and I thought i was pretty sure that everything would check out but when I run it, it doesn't print out the final cout<< and I cant really ...
[3 replies] Last: the value can be what ever is imputed Well, no. While its value certa... (by helios)
Attempting quadratic formula
 
Hello, For my assignment I have to create a program that calculates the quadratic formula. I am at most basic beginner and am having troble, I was told to br...
[no replies]
by shaggy
Writing and saving patterns
 
Hello everyone, thankyou for reading this. I am trying to write a console app that will map out characters and save them to a file for loading later - like ...
[no replies]
Accesing a Mutli-Dimensional Array from another Class file
 
Hey guys, about a week ago I started coding a Roguelike. I've been having structure problems for a while and have sort of been skirting around them. A feature v...
[5 replies] Last: Right-o, thanks for the help. (by frostCrab)
tellg reporting larger file size
 
I have this function: void LoadASCIIArt(string Location) { char* buffer = 0; int FileLength = 0; //creating a ifstream object ifstream File; ...
[2 replies] Last: Thanks.. I didn't realize that i could open a text file in binary mod... (by pogrady)
Calculator Program errors
 
I have several errors in this program. I'm having trouble using static_cast. Can someone please help me use static_cast in this program. I'm completely clueles...
[1 reply] : why are you doing this following part of code...? int Operator = sta... (by HiteshVaghani1)
by lrj
type 'double' unexpected
 
I am writing a program for a class that I am taking and when trying to define the constant 'pi' I am getting error C2062: type 'double' unexpected. Below, I hav...
[2 replies] Last: WOW! I have no idea why I didn't catch that. Thank you for your help! (by lrj)
I think I am stuck
 
I am working on some homework for school and I have to use functional decomposition for when someone inputs 1-365 it outputs the month, here is my code so far: ...
[no replies]
While
 
I'm trying to calculate pi without using for. However when I execute my program it just goes on and on forever. Probably because I'm not using "while" properly ...
[12 replies] Last: Reduce the tolerance, and your answer will be more precise. By the way... (by JellyFox)
Not understanding static_cast
 
Can someone give me an example of static_cast Is it possible to use static_cast within an if,else if, else block?
[3 replies] Last: See also http://en.cppreference.com/w/cpp/language/static_cast for sli... (by Cubbi)
Clock
 
this is my mid term project. I think Ive got it down, but I was hoping some more experienced eyes could look over my code and offer any suggestions because I re...
[3 replies] Last: thank you! (by nothing3)
Invalid Initializer
 
Got an error called "6 C:\Dev-Cpp\ARRAYS.CPP invalid initializer". This is the first time I'm trying out arrays. #include <iostream> #include <cstdlib...
[5 replies] Last: C:\Dev-Cpp\ARRAYS.CPP Don't use Dev-C++, its old, outdated, bug fil... (by ModShop)
C++ HELP PLEASE PLEASE!!!!!!!!!!!!!!
 
Okay my code is below, and I was wondering how to let the user type in an output file name instead of it sending to one I made. In other words I created a file ...
[no replies]
problem with a simple function
 
Hello!! So I need a little help with this function I am trying to write. It is very simple beginner stuff but I really am not seeing where I am going wrong. ...
[5 replies] Last: RE: JellyFox I did that with int t because I need to declare a variabl... (by hvacjesse)
count #of words and characters..!!
 
int main() { unsigned long i=0; unsigned long len=0; unsigned long st_pos=0; unsigned long i_init = 0; unsigned long index = 0; string s = "this ex...
[no replies]
skipping a line of text when using getline() function with a textfile
 
Hey guys, I'm using getline() in a loop to get lines of text from a text file and do stuff with it. Now I need to make a function within this loop to skip li...
[2 replies] Last: Hey I actually tried the first function, but I never saw the second fu... (by jktexas1)
September 2012 Pages: 1... 89101112... 62
  Archived months: [aug2012] [oct2012]

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