Beginners - May 2015 (Page 30)

File Read
 
while(fread(&book, sizeof(book), 1, library) == 1) I have a quick question regarding this line of code. Is this reading in the first record from a file? ...
[13 replies] Last: Yeah, so I could say while 10 items are properly read, write fwrite()... (by Bogeyman)
by koopey
beginner in classes. pointers problem
 
beginner with classes. The following code didn't run with pointers. but ran fine without pointers or even with reference. error says: This application has requ...
[3 replies] Last: it worked. :) thanks. (by koopey)
How to include my own library in Codeblocks
 
Hello, I'm a beginner in C++ and Codeblocks (using Windows) trying to include my own library in a cpp.File. I googled a bit and tried out the following: 1...
[1 reply] : Did you compile the library project? Where is the compiled binary lib... (by keskiverto)
Check value of member variable directly or through member function?
 
Take a look at the code: class A { A() : empty{false} { } bool is_empty() const { return empty; } void fill() { // Here's my question //...
[1 reply] : I don't think it will be more expensive. The compiler will probably ch... (by Peter87)
Turning a int into a char
 
Hi everybody. I am making a code where it compares two different char, the problem is that one of the variables is a int and not a char. I tried some differe...
[4 replies] Last: A string does contain numbers or letters. It is an array of one, or th... (by admkrk)
Very Simple Program Help
 
Hi, I'm a beginner in C++ and I was wondering on this issue. I have a book and I'm on page 12. Here, it gives me the code for a very basic C++ program. So, I f...
[2 replies] Last: Thanks man (by hibyecake)
read from file-Error
 
I'm writing a program to retrieve data from a text file and store them in a struct but the function completely skips the while loop. #include<iostream> #i...
[2 replies] Last: Yeah i made some mistakes when writing to the file itself, its working... (by zaiken2708)
oop initialize objects and passing of objects b/w classes
 
I have 2 questions, both are asked in comments in: 1)class ATM constructor ATM() 2)class Withdraw constructor class ATM{ BankDatabase bankDb; int account...
[3 replies] Last: am i right with the below concept ? suppose BankDatabase took 3 a... (by aseemgoyal)
by nruiz8
Issues Making a Histogram Function on C++
 
My assignment was to do the following: Write a program to simulate rolling a die 100 times and to display each outcome and a histogram of the outcome. Keep ...
[1 reply] : Put those if else in while inside printStars to for loop inside main, ... (by LendraDwi)
by koopey
classes stuck. can't move forward. Help!
 
HI. I am beginner in classes. how to work with dynamic memory in classes. I am not able to allocate dynamic array simply in public or private field. so instead ...
[8 replies] Last: You should have seen me smile right now. it worked! thnx a loooooot. (by koopey)
Reading Data from a file with a selection option
 
earlier last week I posted a question about file reading. I really didn't get the responds I was looking for. So after reading a bunch of info on for loops and ...
[1 reply] : #include <iostream> #include <iomanip> #include <string> using name... (by Gmoney2015)
binary_search for strings won't work
 
Anyone have any idea why this won't work? It won't seem to find my string. When I check if they're inside the vector they definitely are there. I've tried with ...
[1 reply] : Test if value exists in sorted sequence You search from unsorted .... (by keskiverto)
Codelite Automatic Asterisk
 
Whenever I'm making a multi-line comment in codelite, it automatically creates an asterisk when I press the return key. It's really annoying. I have searched al...
[1 reply] : Under: Settings->Global Editor Preferences...->Tweaks->Code uncheck "... (by norm b)
Reading a input text file into a string
 
I have a text file in the format of the following: 1 25.00 hammer 2 300.00 chain saw 3 3.00 dust pan 4 20.00 wrench Now my confusion comes because I ne...
[2 replies] Last: Thanks that set me on the right course. Here is what I did... int I... (by tehgoat)
2 Unresolved external symbol errors
 
I am getting 2 unresolved external symbol errors (Error 1 error LNK2019: unresolved external symbol "private: class SetUp __thiscall SetUp::_setUp(int)" (?_setU...
[9 replies] Last: Many thanks. I have been halted from working on my game for quite a wh... (by AmazingBKaiser)
Reading random words from file
 
Hello World! I am currently writing a password generator in Microsoft Visual Studios 2010 Professional. The section I am having a problem with is the practical...
[no replies]
Printing formatted output
 
I'm currently trying to print out a histogram of sorts in a format. Here is my code: int main(){ for (int i = 90; i >= 0; i -= 10){ cout << setw(10) << i ...
[1 reply] : Bump? (by strayyamato)
Calculator
 
I've been trying to create a simple calculator, but whenever I fix an issue, another one appears. Was wondering if I could get a good scripted calculator, so I ...
[8 replies] Last: One method is to check the next character of the input buffer without ... (by Tom56785)
Car Simulation Project
 
Yes, I have a problem with this Car Simulation project that keeps not compiling. keeps on saying expression not used Fuel::Fuel #include <iostream> #include...
[4 replies] Last: Yes, and you haven't read my last post either. Put your code in code... (by Codermik)
Age Calculator Problem
 
Hi, fellow programmers. I am programming about an age calculator. It's simple: 1, get the input date 'today', check if its valid 2, get the input date 'bi...
[1 reply] : Well, from my point of view, you got a lot to do to debug this program... (by FlyingC)
May 2015 Pages: 1... 2829303132... 40
  Archived months: [apr2015] [jun2015]

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