Beginners - June 2015 (Page 30)

File header errors
 
Hello. I couldn't solve this problem as I don't understand why would the complier produce such error messages for this header. #ifndef golf_H #define golf_...
[7 replies] Last: Actually golf.h shouldn't be compiled, it should be #included. Yes, ... (by Peter87)
terminate called after throwing instance of std bad_alloc
 
I cant seem to find the error with my code.... I dont think im using too much memory. Here is my class declaration: class course { private: st...
[4 replies] Last: yeah thanks. i got it now. (by toesockshoe)
Drill Chapter 4 Programming Principles and Practice
 
Hello, I am an extreme beginner at C++ and am trying to learn this language through one of the creators books. I'm working on the drill in Chapter 4 and am havi...
[13 replies] Last: for(int i = 0; i < converted.size(); ++i){ co... (by JLBorges)
Constructor for a class that takes in another class as parameters
 
I'm trying to make a class called Book that stores the Book title and Date. Paratmeter for title is simple enough, but I don't know how to pass in a Date as a ...
[5 replies] Last: Thanks for the help guys. Now I'm trying to pass in a vector of author... (by Extreme112)
Range based
 
Hey all this code is actually from the tutorial section, and it's not working... I'm brand brand brand new, I have been manually typing out code to get a feel f...
[3 replies] Last: Thank you very much for your prompt answers. (by Jammin73)
by FASI
file handling :'(
 
GUYS!!! I need help!!!! this code is thought to give me the string i enter with spaces ...instead it give a insane number....!! #include<iostream> #in...
[1 reply] : you dont need getline in line 16 (by shadowCODE)
stopping when user presses enter only, during c-string entry
 
Okay this is extremely silly, but I'm having a huge hard time with it. I'm trying to make a loop and the user adds a new product to an array on each iteration....
[2 replies] Last: The extraction operator, when extracting strings or numbers leaves the... (by jlb)
by FASI
cant read whole string in file handling
 
using this for cin ofstream newsuspect("newsuspect.txt", ios::app); system("cls"); cin.ignore(); cout << "Enter the new suspect's name" << endl; getline...
[2 replies] Last: some random number shows up :/ (by FASI)
Second Largest Digit in a number
 
Hi.! I am a beginner in c++. i came across a question where you have to find out the second largest digit in a given number. Such as : (1) Input : 8735 Ou...
[11 replies] Last: As this is a beginner's exercise I would have thought resorting to th... (by cire)
semicolon just after if() ?
 
Please explain what the 2nd line means when we put a semi colon just after if(...) if (m_dataOffset) { if (write(1, m_data, m_dataOffset)); m_d...
[2 replies] Last: A statement that consists only of a a semicolon is called a null stat... (by Peter87)
error C3074: an array can only be initialized with an initializer-list
 
Hello. I want to open a directory, get his files, unzip it and move it in another directory(7zip problem B|), then get again the file from second directory, sto...
[2 replies] Last: Thank you very much ! (by lTachyon)
Algorithm Development
 
Hi all, I'am trying to self-study some programming topics that were not covered in any of my previous programming classes. I would like to learn/review some ...
[no replies]
by pravi
C program using function
 
What is wrong with this C program using function? <//To find the power of a number #include<stdio.h> #include<conio.h> int power(int a,int b); int mai...
[4 replies] Last: Until you set the value of a variable for the first time, it isn't set... (by shadowmouse)
by pravi
Switch statement
 
What is wrong with this C program using switch statement which terminates after typing symbol? <#include<stdio.h> #include<conio.h> int main() { int a,b; ...
[7 replies] Last: @4682 Thanks for all your useful replies. I have solved it. Couldn't h... (by pravi)
Making a grid
 
Hello, I am currently trying to make a grid, say 10x10 that will represent a 2-D space. I want to make the numerical values 0-99 "boxes". These boxes will have...
[5 replies] Last: Made both changes and it worked. Originally I kept it as box because ... (by Jonnyd36)
Looking for help with a binary file.
 
Hello. My task is to create a program that puts all the reserved c++ words (Max length 30) into a ordered table. then i need to write a function which using bi...
[14 replies] Last: See comments in code. Andy #include <iostream> #include <fstream> #... (by andywestken)
by koopey
basic input/output with files driving crazy
 
I finished reading my c++ book and the tutorial in this website. both had similar contents but none tackled the problems I am facing and am still struggling to ...
[7 replies] Last: > in which truncate if file exists, i think it should be do not trunca... (by JLBorges)
Make an instance of a external class
 
Hi, I'm used to program in Java and I started to program in c++. Now in java if you have 2 classes (Class1.java and Class2.java) you could say in Class1: mCl...
[9 replies] Last: The #ifndef CLASS2_H is an include gurad: http://en.wikipedia.org/w... (by coder777)
menu choices (interpretation?)
 
Hi I have been trying to create a menu with the following code. The menu here is made of 2 choices. However if I give for choice=1, I get the error message (L15...
[5 replies] Last: The performance is the same either way. The boolean expression is chec... (by mlholder)
Function Pointers to access a function outside a class
 
Hi there, first time poster. I was pretty confident programming in C but C++ and it's classes are still a bit new to me. I'm trying to build a class that...
[3 replies] Last: great thank you guys - legends! it compiled in the end. I'm working f... (by Moookeee)
June 2015 Pages: 1... 2829303132
  Archived months: [may2015] [jul2015]

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