Beginners - March 2011 (Page 35)

Segmentation Fault in a for() loop
 
Hi, I'm pretty new to programming and I'm sure this is a quick fix. I've just been staring at this code for hours so nothing is popping out at me that would ind...
[4 replies] Last: The q-0 is a mistake in my copying. It is actually q=0. However I'll l... (by lzdmnstr)
first program not working!
 
ive been reading the tuts on this website and i made my first program but it doesnt work! here iz my program #include <cstdlib> int main(){ cout<<...
[4 replies] Last: it works! thanks fili! (by DeadOverclock)
debugging recursive functions
 
what is the best known method for debugging a recursive function ?? how do i make things print and make sense of things it is doing ? any standard or genera...
[1 reply] : If you want something pretty, you can use a static variable inside the... (by Zhuge)
How to find length of sub-array
 
Here is my piece of code: int b = { {4,6}, {-3,0} }; int b_length = (sizeof b)/sizeof(int); int *sub_b = b ; ...
[3 replies] Last: Use a vector. (by rocketboy9000)
by ladman
String subscript out of range?????
 
i have this program for an school assignment. the goal here is to open an exicting data file, have it sorted, then add up the total gross for each individual an...
[2 replies] Last: dude you are a live SAVER!!!!!!!!!!!!!!!!!! that fixed it. dont know w... (by ladman)
by Jawsh
How to read in a text file and store into an array?
 
HI everyone, I am trying read in a text file with a 10 by 2 array of values into my program and I would require the program to assign it back into another ar...
[4 replies] Last: Thank you hanst99. I have came up with the code below and the output ... (by Jawsh)
Returning an array from a function
 
Hi, I've googled this and found loads of threads, but none seem to help me. I am doing a project which requires me to use a function that uses an array from...
[4 replies] Last: Brilliant! Thanks for the fast responses. (by Dave1123)
HELP!!! (code problem) Qwik ?? about #s from the keyboard and add them together!!
 
ok so i used the code listed below, BUT when i build the solution an error shows and says that "cout, cin, and endl" are "undefined" I am using Microsoft Visua...
[2 replies] Last: They are inside the std namespace. You can fix that by adding using n... (by Bazzy)
Problem overloading pre-increment operator (++)
 
Hi I'm not sure if this is a beginner's question... I'm trying to create a Date class and override some operators. class Date{ private: int _day, _month, _ye...
[4 replies] Last: That worked :D Now why didn't I think about that...? Thanks. (by Maxeipi)
by arash
>> dont work with string type ??
 
I was just playing with MS VC express 2010 to remember C++ but I could not compile the following standard code for getting input and display it ! // a small C...
[2 replies] Last: DUMB mistake! thanks! (by arash)
by tonnot
Code to know memory use under windows without MSVC ?
 
I want to know the memory use (Windows) of my program written with Qt (So I have not MS). Can anybody tell me some useful (code or link) Thanks
[1 reply] : This describes the different kinds of counters and has a link on acces... (by kbw)
Compiles fine but get error when I try to execute
 
When I try to run the program, it comes up with this error window: http://i.imgur.com/M1ClO.jpg #include <iostream> #include <string> #include <sstream> #inc...
[1 reply] : Your code throws an exception of type length_error; http://www.cpluspl... (by Moschops)
Function exit to main (1,2)
 
I got a function that enters data to an array. When i call the function i want to store data in element 0 and then exit the function and go back to main. When i...
[22 replies] Last: You don't seem to have the right perspective of C++ logic. In this cas... (by closed account S6k9GNh0)
by GulHK
vector unique problem (1,2)
 
..........
[20 replies] Last: I'm SORRY people. It was the actual code I have been working on so I r... (by GulHK)
infinite loop troubles
 
im trying to write code for my previous boss but can not seem to get the program to be "idiot" proof. im wanting to have multiple checks so that when someone in...
[5 replies] Last: yea im using it (system("pause")) to get echo prints but its saving ev... (by jpinckley)
Problem with palindrome
 
Hey guys, i'm having problems with my palindrome function. Sometimes when it is a palindrome with a space it declares that it isnt a palindrome and if there's a...
[2 replies] Last: and what's up with the break statement? your for loop is not a for loo... (by propohetjohn)
rand() help required.
 
Hello. I need to make a random number generator for numbers between 1 and 3. I also need to do this using srand and rand in two separate functions. My issue is,...
[4 replies] Last: +1 Zhuge. This code, for example, should work. You can try it for ... (by Disch)
Expand function
 
I am working on expand function, that asks to write a C++ command-line program that includes a main function and an expand function. The main function should as...
[4 replies] Last: The function is suppose to print the expanded string, re-allocate memo... (by alex58765)
question about file organization
 
Hi, all - I'm writing my first C++ program for a real-world application right now, and am trying to figure out a good scheme for what to put in which files. ...
[12 replies] Last: if possible, i would write a function, that when called returns the st... (by propohetjohn)
classes confusion
 
Ok I have 2 classes. Class core and ball. Class ball is inheriting cores public members. But I have a problem. Both classes use each others members, so what I d...
[2 replies] Last: Give us a small example of what you are trying to accomplish and we'll... (by PanGalactic)
March 2011 Pages: 1... 3334353637... 52
  Archived months: [feb2011] [apr2011]

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