Beginners - April 2018 (Page 20)

Proper use of ifstream and Funtions
 
This is the code I've attempted to use: /************************ Purpose of the Program: Rea...
[3 replies] Last: It's kind of silly to have a function just to open the file. Instead, ... (by tpb)
Access to private class members
 
Hello there, I am a complete new beginner here. I am trying to load a .txt file which contains a few...
[10 replies] Last: string File; for (int i = 0; i < 4; i++) if (myfile >... (by keskiverto)
by abir50
what am i doing wrong here?
 
I am doing a project for class and since I am not allowed to share/post it so i made an example of t...
[5 replies] Last: damn i didn't even realized i had that, must have done it by accident,... (by abir50)
Vectors and Classes
 
Currently in c/c++ programming 2 and trying to expand my knowledge of classes and vectors and how th...
[11 replies] Last: A free function is just a non-member function (outside of the class) ... (by jlb)
Should I used “dynamic allocating array” or “Vector”?
 
just read about Vector and it’s basically an improved array?
[2 replies] Last: Hello BambiWithPMS, Yes this is true. At its core it is still an arra... (by Handy Andy)
Ignore
 
Please ignore
[1 reply] : Please do not post multiple times. http://www.cplusplus.com/forum/beg... (by closed account E0p9LyTq)
Question regarding switches, I think.
 
This is a snippet of a program I'm working on. The idea is that it switches between active and not a...
[3 replies] Last: I do not understand the necessity of bool if I can use int. Using ... (by closed account E0p9LyTq)
Delimiter not working
 
For a project I have to pass data from a file into an HTML code. The delimiter is not working (\t) i...
[6 replies] Last: Hello aaronpeart, While I was playing with your program I realized th... (by Handy Andy)
by abir50
counting primes between 1 to x
 
Trying to get pi(x)=number of primes from 1 to x but i am totally lost after getting up to here. ...
[6 replies] Last: You should probably increment the count, not just assign 1 to it. (cou... (by Ganado)
What are strings?
 
I just started learning c++ without any previous experience in programming and i am quite baffled as...
[1 reply] : It's best to think of a string as a sequence of zero or more character... (by JLBorges)
by abir50
void test function
 
For a project i am asked to find primes from 1 to x and then use the number of primes to solve the P...
[3 replies] Last: This description matches the given output: // Loop i from 1 to n. In ... (by dhayden)
Problem with M_PI
 
Hello I need some help with this code. I got this expression: M = 4/3(p*pi*r^3) where p is a c...
[2 replies] Last: oh! thanks helios ! (by bonecrunch)
c++ problems updated!
 
I think there is something wrong with my constructor. Can someone please help?? #ifndef INTEG...
[2 replies] Last: You need to set the A's elements to 0 in the constructors. Something l... (by tpb)
Reading file into a class array
 
For my homework assignment, I have to create a class titled "Book" and I need to read a file, of a m...
[5 replies] Last: since you have various types of data for a single book I would suggest... (by closed account NCRLwA7f)
How to use in.get() with text file
 
I'm writing a program that reads in words from a text file into a stack and queue to check if they a...
[5 replies] Last: I'm only to use characters, not allowed to use string type at all (by ElleJay)
C++ to Assembly code
 
hello everyone, does anyone know how I can start a c++ program and drop down to assembly code for a ...
[2 replies] Last: yes, This is good, I didn't know what it was called....I was under the... (by closed account NCRLwA7f)
Counter returning 1 more than expected
 
This code counts all the names on a file. There are 26 names in the file, all on separate lines. How...
[2 replies] Last: Yeah you were right there was an extra blank line at the end, thank yo... (by One Pea)
Add AI to Tic Tac Toe
 
Hey, I need to make it so that my Tic tac toe board is against the computer rather than against ano...
[4 replies] Last: Also, try to make everything relative to the size of a side. I could ... (by icy1)
by Fishy
Why wont this very simple program with classes and files compile?
 
Why wont this very simple program with classes and files compile? This code is from a YouTube tutor...
[4 replies] Last: I went back and watched things again including how he created projects... (by Fishy)
Having some linker problems with gcc...
 
Hello! I'm having some trouble getting my program to compile. The purpose of this program is: ...
[4 replies] Last: also when you compile be sure to list all the .cpp names: g++ -std=c+... (by nether)
April 2018 Pages: 1... 1819202122... 25
  Archived months: [mar2018] [may2018]

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