Beginners - December 2008 (Page 3)

by Vector
returning a string
 
... Alright this is much better! But i dont know the primary expression that is exepected on 27 before openInputFile. int main() { string MyFile,...
[7 replies] Last: Keep in mind that local objects go out of scope when the function that... (by helios)
using a PRNG to fill an array
 
Hi, I am writing a program in which I need to take 21 #'s generated by a PRNG and use a loop to put those 21 values into an array. I have my code listed belo...
[no replies]
by gulu
operating arrays
 
We are asked to read the top right triangle of a 2d array-I dont know if I can illustrate it but imagine the 1s and 0s to constitude the cells in the 2d array. ...
[3 replies] Last: Right. Here are some hints given under the assumption that final2D is ... (by Corpus)
by elpis
Character array crash
 
I am using VC++ 6.0 IDE #include <iostream> using namespace std; int main() { char szArr1 = "Hello"; szArr1 = 'S'; return 0; } The a...
[2 replies] Last: Understood. Thanks! (by elpis)
Can't copy and reverse the string!!!
 
Dear All, Following are the codes for copy and reverse thhe sentence by using strings. But as i run the codes it only except character and cursor stays at o...
[3 replies] Last: Please use getline(cin,szSource); instead of cin>>szSource; R... (by elpis)
by Dodle
Can't compile wxWidgets with Mingw32
 
Hello, I am new to the forum, and pretty new to programming as well. I have been using wxWidgets with Python but recently wanted to learn C++. I am running Wi...
[5 replies] Last: I think I've made some progress, but can't get past the following erro... (by Dodle)
by gulu
Recursive functions ( finals!)
 
I have my CS finals soon and still dont get recursive functions. I answered the question to program the following code and got it right but dont actually know h...
[6 replies] Last: Again thanx for all the posts I understand the concepts better now (by gulu)
Got error trying to returning a pointer to an array of String
 
Hi, My intention for the following function is that you input a string in and the function will split the string (substring it) into several strings seperated b...
[2 replies] Last: Actually, the problem is that I got Logic error. It's OK, problem solv... (by untitled)
bus error
 
here is my code #include <stdio.h> int main () { FILE * message; FILE * changed; int encryptnumber; int messagepart; int choose; me: p...
[9 replies] Last: of course its something simple like that!!!!! but this still dosnt sol... (by cyberpirate)
To stop a timer by pressing an keystrokes
 
Hi can anyone teaching me about how write a C++ program to stop a timer to continue counting by just simply press ALT on keyboard to stop it or just press s o...
[5 replies] Last: You dont need to clear/flush the buffer for that (it's possible, but I... (by Scipio)
by nino14
Rand()
 
#include<iostream> #include<ctime> usingnamespace std; void main() { int x,c=0; srand(time(0)); cout<<"Enter a number betweeen 1 and 15\n"; cin>>x; whi...
[1 reply] : Change the argument within the while loop to while(x <= 15) But you ... (by LacViet)
regarding function __declspec()
 
Hi, I have downloaded some online available code from following link: http://sourceforge.net/project/showfiles.php?group_id=214368 It does monte-carlo ...
[1 reply] : It's not a function, it's an extended syntax for the purpose of genera... (by helios)
by II15X
Something other then system("PAUSE")
 
I read the forum about console closing down, and it just got out of wack... But I am looking for something simple ... I tried get.line; but it doesn't work? ...
[3 replies] Last: It was explained in the second post of http://www.cplusplus.com/forum/... (by Bazzy)
deleting a string *
 
I have this section of code which is causing me trouble, more specifically a segmentation fault: ... if(tokens =="angle" || tokens =="Angle") { //create ...
[2 replies] Last: Even if you comment that line, you have a much more serious memory lea... (by helios)
A lottery program. Good one to learn basic stuff.
 
So I managed to finish my program that randomizes 7 numbers between 1 to 48 and it checks are they already in use. I made it for windows. Not hard to port i...
[2 replies] Last: Then you just change the number it passes to the RandomNumber(49, 1) ... (by Akingboy)
by M689
Generating a series of number
 
Hey, i am having my first course in c++, it was all going very easy until i had my mid-term yesterday the first question in the exam sheet was to write a progra...
[6 replies] Last: The difference of even number POSITION in the series is 7 6 5 5 and th... (by rahulcrjk)
copy file
 
I have two files The first file: // first.cpp #include <iostream.h> int main() { cout <<"hello world"; return 0; } The second...
[5 replies] Last: >> will skip things like Carriage Returns, Linefeeds, spaces, tabs ... (by guestgulkan)
C++ File Handling
 
plz someone suggest me a good e-book for c++ file handling which covers newbie and advance users, a specialist book only for file handling. sorry for poor en...
[2 replies] Last: It all depends on what level, or OS you really want to target. 1. H... (by guestgulkan)
by PUSS
pls h have problems whit condition of if ()
 
//my code if ( date.year <2000) { int i=1900; if ((date.day ==29 && date.month ==2) && !((date.year −i)/4==0))return false; } if ( date.year ...
[4 replies] Last: I know ,I changed it trying to fix the problem but 10x any way (by PUSS)
Class deconstructors?
 
I have here a bit of code like this: void *data; lol_e type; public: lol_t() {data = (void*)new int(0); type = numbar;} lol_t(NUMBAR n) {data = (void*)n...
[2 replies] Last: (Whoops, I noticed that that "public:" shouldn't exist) I typedef'd... (by demosthenes2k8)
December 2008 Pages: 12345... 17
  Archived months: [nov2008] [jan2009]

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