Beginners - September 2012 (Page 61)

Vector problem: Program crash
 
I'm new to using vectors, and in all descriptions I read, there is a lot of mind-blogging information about pointers. I do really not get it, doesn't matter how...
[3 replies] Last: By the way you could have one vector for names and types std::vector... (by vlad from moscow)
fixed
 
fixed
[6 replies] Last: Yeah I actually tried that before and it didn't help. Thanks for helpi... (by jamesdi3)
printf
 
hey guys could somebody help me? i want to create a simple program which prints this , using printf function: 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 4 5 ...
[10 replies] Last: int rows = 7; //number of rows you want to print int mid = 2 * (ro... (by ssrun)
by modic
Having trouble with the "Hello World" program.
 
Everytime I try to "Hello World", I always get an error stating that the program is illeagel. Considering syntax errors. Now I'm getting one saying I need a 32-...
[12 replies] Last: Don't worry :) I finally got it to work! :D (by modic)
While Loop
 
How to use the while loop? What is the difference between while and do-while? simple example pls.
[16 replies] Last: yes. is it wrong? if there is a wrong part please let me know. that'... (by chipp)
how to check if "rewind" works?
 
The program is supposed to read the number of vowels and the number of consonants in an external file (".txt") which it does, but I need to be able to "rewind"/...
[8 replies] Last: do { getline (inf,sentence); c += sentence.length(); n++;... (by tntxtnt)
not showing the total. (1,2)
 
guys, how can the total show up? #include <iostream> using namespace std; void sum(int num1, int num2); void difference(int num1, int num2); void pr...
[34 replies] Last: @op: btw, your request is a little bit strange/weird... in case that ... (by chipp)
Is it possible to access data members from other objects within an object's function? (and more)
 
I can't think of a good example, and I don't think I can really elaborate further either. Also, how do I access another variable altogether (from within a me...
[6 replies] Last: I added the brackets because normally I would construct a Gun object w... (by georgep)
Problem creating movie archive
 
I wish to create a movie archive, in wich I can store the movie titel and what kind of media it's on (DVD, Blueray, VHS). I tried do it like this, after read...
[5 replies] Last: Works like a charm! Thank you very much! I will probably be back with... (by Hashimatsu)
by beakie
Easy Syntax Question
 
Variable theNumbers is a pointer to an array of ints in myStruct. This is OK. int numbers = {1, 1, 1}; myStruct.theNumbers = numbers; How can I...
[3 replies] Last: Use std::vector<> ? http://www.codeguru.com/cpp/cpp/cpp_mfc/stl/arti... (by JLBorges)
Encryption (1,2)
 
Hi there! I'm new to c++, I've tried to compile some code's, just to try it.. Well, encryption is very interresting to me, I've found this code: #include <i...
[24 replies] Last: Great!! The code finaly works! Thanks all! Here is the final source, I... (by closed account 4i67ko23)
function getting user input and passing it to another function
 
Hi all Hope all are fine. I have a problem in which I have to find out billing amount of lawyer for his client. I need to get the following inputs from user:...
[2 replies] Last: Hello maniax, Thanks for you help. And sorry for the late reply. I us... (by vichu8888)
ofstream
 
#include <iostream> #include<fstream> #include <conio.h> using namespace std; void main() { int **a; int limit; cout<<"Enter Order Number for matrix...
[8 replies] Last: Well done! Glad I could help :) All the best, NwN (by closed account o3hC5Di1)
by bitani
const_cast() - What's the difference?
 
Simple question.. why does this not work: (output is 50) void changeConst(const int * p) { int * newP = const_cast<int *>(p); *newP = 150; } int main(int ...
[7 replies] Last: [quote=bitani]Peter, it works if it's const int * A = new const int(50... (by Peter87)
String Help
 
I have the following program and do not understand the error: #include <iostream> #include <string> using namespace std; int main() { string s; int vo...
[4 replies] Last: Really? i never knew that. Hmm learn something new every day. (by Ch1156)
Access specifier error
 
When i compile this program //This program is for making a whole class friend & other stuffs. #include <iostream> #include <string> using namespace std; cl...
[2 replies] Last: TThanx a lot friend. (by bigo005)
Error for dynamic 2d array
 
thanks
[4 replies] Last: You're defining a twice: int** a; ... vector<::vector<int>>a( lim... (by Disch)
txet file
 
Hi so this is what i would like to do is use this function OpenTextInputFileAndOpenTextOutputFile to open text files but i get am error in man for key, argc,...
[5 replies] Last: Yeah, this should work, you're declaring all your variables and handle... (by BlackSheep)
magic squares dimension
 
closed
[4 replies] Last: You want dynamic memory: http://www.cplusplus.com/doc/tutorial/dynamic... (by BlackSheep)
How to put the code in the purple field?
 
My quest is : How to put the code in the purple field? and thanks for reading
[4 replies] Last: well thanks a lot both of you soranz and HiteshVaghani1 problem solve... (by closed account 28poGNh0)
September 2012 Pages: 1... 59606162
  Archived months: [aug2012] [oct2012]

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