Beginners - July 2012 (Page 6)

by wr0124
why this error ??
 
when i run the code,, it shows: *** glibc detected *** ./c1a: munmap_chunk(): invalid pointer: 0x00000000146fe250 *** ======= Backtrace: ========= /lib64/l...
[2 replies] Last: Whats your code? (by Owain)
I/O Streams
 
Hi im trying to read the first line of the following text file after its been read once all the way with good() method. The following is my text file named "tes...
[4 replies] Last: Problem solved! Thank you Cubbi. I don't know what a failbit set is. (by johnny92)
do-while loop with string not working?
 
I have the following code. As noted, the top part(before the loop) works perfectly (yay!), but once I enter the loop, it does not work. I am trying to replace...
[3 replies] Last: No, it is not solved. My problem is that it is only entering the code ... (by janie29)
Undefined Reference Errors
 
I've been working on a C++ project the last couple days and this has really stopped me in my tracks. When I attempt to run the program I get multiple instances ...
[10 replies] Last: I'm a little annoyed with myself that I've wasted so much effort when ... (by TethArck)
Need to get last 2 characters from string
 
I need to get the last 2 characters from the last name which is input from the keyboard. I am trying to use "thestring.copy(str, x, n). I do not know the length...
[3 replies] Last: Just figured it out when I saw your reply. Thank for you help. (by thumperslpss)
i am wondering about iostream..
 
just a quick question, I have been programming for less than a week, learning all sorts of neat stuff, but making sure I am trying to learn everything. The one ...
[3 replies] Last: thanks guys I was just wondering, now I am going to go back and write ... (by mickeyliv)
by wr0124
Segmentation fault: 11 in C++ of STL
 
hi, I get problem with c++ STL, it is always Segmentation fault: 11. is that because i use vector<int> Sp, and Sp.clear(), then Sp actions too many times(1e3)?...
[3 replies] Last: Are you sure that i is always less than SpeciesAge.size()? if ( Speci... (by Peter87)
Delete in middle of array
 
What is the result of the following: char* str = new char ; delete &str ; does it delete the whole array? or only half of it? Thank you!...
[3 replies] Last: No. Do not do this, it is undefined behavior. Always, always, ALWAYS ... (by Nexius)
string to character??
 
I cannot for the life of me figure out how to end the loop if the customer enters 'E' or 'e'. I have to use a string for the userCustomerCode, so how do i chec...
[4 replies] Last: @CosminNTG - I tried that, but every time I entered an E or e to test ... (by scu1casper)
Random number in a array?
 
C++ srand(time(0)); int Rnum = rand()%5+1; int guessArray ={Rnum}; would this be right if I was making a guessing game with random...
[1 reply] : I don't know why you'd need an array if you are guessing one random nu... (by Texan40)
Class error: assignment of data member in read-only structure
 
Hello! I have this code, from the C++ in Action book. #include<iostream> using namespace std; class Input { public: Input() { cout...
[6 replies] Last: I fixed it up. I reinstalled the OS and it compiled succesfully. Thank... (by CosminNTG)
Splitting my code between multiple files.
 
Hello. I've been learning C++. I've recently decided to try and learn the vital skill of splitting my code between multiple files in a project. However, I'm hav...
[2 replies] Last: I'm guessing that you haven't called the function that assigns the val... (by Stewbond)
Read in a lot of character and space.. then convert alphabet to number and space to -
 
i just want to know how can i convert a lot of char input into int. I think the one i had done is not right because it does not return integer and my current co...
[5 replies] Last: when the user hits enter isValidChar() will return false. All you are... (by Texan40)
isdigit ??
 
How can I check if a string contains numbers? I tried isdigit, but it isn't working.
[2 replies] Last: Gotcha. Ok. With the for loop it actually works...i appreciate it. T... (by scu1casper)
bubble sort array
 
i was wondering if someone could look at this. im trying to get these numbers {1,7,4,0,9,4,8,8,2,4} into this order {9,8,8,7,4,4,4,2,1,0}. but once it goes d...
[2 replies] Last: thanks i just changed int end = 10; to int end = 9; and it... (by xobonesox)
by watiss
type float number
 
Hi everyone, I've got a question on C programming (I'm not sure if I've got the right to post it on this forum...) :I wonder how we can get rid of the "useless"...
[6 replies] Last: Does %g help? printf("Vous pesez %g kg.",poids); (by Peter87)
Escape Sequence meaning
 
I am not sure of what the printf escape sequence mean for this one, in addition, I added the revenue variable and it is no longer working, how would I apply ano...
[5 replies] Last: Thank you, I appreciate all the help! (by kevinjame)
Reversi Code Error
 
Hi, I'm a beginner in c++. We were asked to make a reversi game program for two players using loops, char and such. No AI or animation. I'm having problems ...
[1 reply] : You have to specify the size of array when you declare a variable, i.e... (by KRAkatau)
print matrix in a file
 
I'm having problem in printing matrix to a txt file, can you guys help me? thx in advance Here is the code that I've made #include <iostream> #include <st...
[6 replies] Last: oh allright thank you very much. (by febrimaru)
Simple question - what is a "char" variable used for.
 
I've recently purchased "Beginning C++ through game programming third edition" (recommend as a beginner starting C++ btw) And it was telling about some variable...
[6 replies] Last: Now I fully understand it :D Thanks, Guys :D (by DJLad16)
July 2012 Pages: 1... 45678... 54
  Archived months: [jun2012] [aug2012]

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