Beginners - April 2012 (Page 3)

Writing data to txt file
 
I've been going through a c++ book and came across this practice problem in which part of the problem involves writing the arrays into a txt document. I have t...
[1 reply] : for(int x=0; x<4; x++) { fFile.getline(s .name,30); fFile >> s .... (by paulthepenguin)
by niba10
C++ destructor
 
if i have class like Rectangle and i have custom destructor now i have made 3 variables and when program ends it goes to destructor how i know wich variable d...
[1 reply] : What? It doesn't actually sound like your class needs a destructor (I... (by ascii)
Output with structs
 
For this program, I need to be able to prompt the user 3 times for student record info, and when it is all gathered, print to the console everything that was co...
[2 replies] Last: Well, I think I see what the issue is. It works fine, so long as the ... (by chirrrs)
Help Help Help
 
i have trouble starting my final project for my C++ class and heres the layout of the first part.. Command Line Text Editor Part 1: 50% Create a command li...
[no replies]
Implicit Conversion Operators
 
People claim that implicit conversion operators are bad practice, since they allow seemingly unexpected conversions. We all know an object is implicitly conver...
[12 replies] Last: Your assistance is well appreciated, JLBorges :) I feel more knowledge... (by closed account zb0S216C)
Really lost. Can someone help?
 
Working on this assignment. Would really love any pointers. I am supposed to design a basic spelling checker. It looks at a word and then, tells me what kind ...
[no replies]
by Lhimez
Compilers
 
To someone thats new to programming, has some major computer knowledge and would just appreciate complexity; do you have any suggested compilers to use?
[7 replies] Last: Now you made me change my mind :/ (by Lhimez)
how to make a default message for wrong input (1,2)
 
i dont get it when i enter a character it just gives me a long number, why wont it go to the else part? #include <iostream> using namespace std; int ma...
[21 replies] Last: The main problem is that sync() is unreliable, what it does (or if it ... (by Athar)
Is there a more efficient way to write this chunk of code?
 
I have a couple classes under my belt and am learning while loops atm. I have an assignment taking input from a .txt and outputting various mins, maxes, averag...
[11 replies] Last: No better that JLBorges' code when it comes to performance, but if you... (by andywestken)
Taking in multiple user inputs at once
 
Hi everyone, I'm not sure how simple this is but I'm having a hard time figuring it out. I'm building a sort of user file system and I need to take in commands ...
[1 reply] : you can use getline(cin, var) or you can use getline(cin, var, until).... (by newbieg)
Vectors and Pointers
 
I am working on something where I have a class "person" with two fields name and age. A class "car" with 3 fields, the model, a pointer to the owner (person *),...
[2 replies] Last: Oh, I see. Thanks, that helped quite a bit! (by mamu144)
Class and Object
 
Hi there, I'm using codeblock, and below is the sourcecode I have tried to run. #include <iostream> using namespace std; class Venessasclass { public: ...
[2 replies] Last: Hi, newbieg, Thank you for the reply. Sadly, in my sourcecode, every... (by mikevets)
Reading txt file into 2D Array.
 
Got a program that needs to read data from temps.txt. For some reason when I test it with temp and temp I get random jibberish numbers. #include <cstdlib> #...
[no replies]
Why is wxwidgets bad on codeblocks?
 
Whenever i try to to make a gui its realy hard and this is why: Placing things in the GUI. Its realy hard i cant seem to make it place where i want to i place ...
[8 replies] Last: If you're using a sizer, you obviously can't specify the absolute coor... (by hanst99)
returning a value of an array function
 
I am stuck and don't know where to go from here. I have to take the 4 calculated values of a calcMonPayment function and implement it in a print out function D...
[3 replies] Last: Figured it out after studying the book again and reevaluating the prob... (by ettedo2000)
by wadaah
Recursively Pointing 2 Linked List
 
Hi everyone, I really need help on how to solve the problem when we have a list of word(type-char ) in linked list and then connect the word two by two to make...
[1 reply] : Could someone give me idea, please... (by wadaah)
by ozone
POINTER ISSUE
 
[The meaning of an expression using the dereference operator (*) is very different from one that does not: When this operator precedes the pointer name, the e...
[1 reply] : int x; int* p; p=&x; //assigns the address of x to the pointer variab... (by Athar)
Diagnolizing matrix
 
Hi Im trying to write a member function to diagnolize dynamically allocated matrices (arrays). i cant think of a way i would do this. i have the set s...
[1 reply] : bump. (by Omar Alamy)
Help with passing an array of class type to a function
 
hi, i was hoping someone could help point me in the right direction for this problem. im writing a program that creates 3 ships and then tracks their movement; ...
[1 reply] : You can use a nested loop. bool detectCollisions(Ship ships , int numb... (by Peter87)
by ldima
can't write on a txt!
 
Hello,in my program i have to write some points on a txt file,so what i'm doing is: ofstream fileoutput("file.txt",std::ios::out | std::ios::app); //find poi...
[no replies]
April 2012 Pages: 12345... 66
  Archived months: [mar2012] [may2012]

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