Beginners - October 2014 (Page 10)

Differences between int vs long, float vs double.
 
Quick question, I know what each of these are, so far I know that an int can go into a float but not the other way around, how does that work for a float ...
[3 replies] Last: Any integral variable (char, short, int...) can be cast into floating ... (by MiiNiPaa)
stringstream confusion
 
class ISBN { public: class Invalid{}; // exception class string get_ISBN() const ; ISBN(); // default constructor ISBN( int p1, int p2, int p3, char...
[2 replies] Last: Thanks a bunch. I figured there was a better method than screwing arou... (by OldNewb)
by Life24
Module vs Sub-Module
 
Hi, I want know more explain between module vs sub-module. Can you give me one simple example?
[no replies]
by hosoi
Why my output produces the wrong result?
 
I'm trying to add two objects, price and tax in this case, price is 9.99 and tax is 0.87 Supposedly, 9.99 + 0.87=10.86, but somehow my program produces 10.86 ...
[2 replies] Last: Thanks a lot ! Can't believe I made such a silly mistake lol (by hosoi)
Using a function to reverse an input number
 
So I'm very new to c++ and I'm taking a class for it right now but I feel like I'm not really understanding some of the material. I've tried the textbook and no...
[1 reply] : first try simpler things... 1. try to reverse inside main function. 2.... (by anup30)
full scripts in support files?
 
I am just starting to learn c++.. I am a little confused how header (.h) and extra (.cpp) files work. I made a simple (and working) add two numbers together ...
[2 replies] Last: If you want more specific help, post your code and I'll look it over. (by Esslercuffi)
by CDavis
Classes
 
So I've been researching for a couple hours tonight and I have an idea of how to do my assignment correctly and started my class so far and made it public. Alt...
[1 reply] : Make the members of overFlight private. (by Cody0023)
const parameter access problem
 
I've got an exercise to design and implement a class which holds name and age vectors. Further exercises ask me to implement a global == operator overload which...
[2 replies] Last: Thanks, that helped remove my head from its rectal entrapment :) (by OldNewb)
911 Help needed please!!!!
 
So the code below should make my array print out in descending order correct like 10,9,8,7,6,5,4,3,2,1 if (userinput == 2) { int i, next; ...
[no replies]
please I need help ASAP
 
please I need to implement code using vector 2D Arry, this is my code but is wrong I don't why? #include <iostream> #include <vector> using namespace ...
[4 replies] Last: your compiler doesn't support C++11 compile in http://cpp.sh/ use Or... (by anup30)
arrays and char. (1,2)
 
hello, i want my program to make user input 10 numbers into the array, but i also want the program to stop at any time when user inputs a letter instead of a nu...
[23 replies] Last: It's saying cin >> array , charcheck; isn't valid. I must be using the... (by UnclePutin)
by Flurr
First Project- Switch case infinite loop/possible if statement trouble.
 
I have to create a project to get a students info and use strings and structures and can't figure out how to get out of this infinite loop. case 1 is for enteri...
[3 replies] Last: Under what conditions does your program loop? I entered 1 and it pro... (by Flurr)
Beginners Exercise, move traps around
 
I am doing the following exercise Make a program that outputs a simple grid based gameboard to the screen using either numbers or characters. i.e. . . . . ....
[5 replies] Last: What he is saying is that srand() needs to NOT be inside the loop. You... (by firedraco)
Using current time as the condition in selection structure
 
Hi, here is my condition...I was given a menu which is restricted to time, I.E: breakfast only available from 8 to 10...and so I want to allow the user make ord...
[5 replies] Last: no problem (by geniusberry)
help with pointers
 
can someone explain how we got the output please #include <iostream> #include <ctime> #include <cstdlib> #include <iomanip> using namespace std; ...
[2 replies] Last: Why did you make your main a void? You need to make it an int first an... (by UnclePutin)
trace
 
Can someone help me understand how we got the result with this code? #include <iostream> #include <ctime> #include <cstdlib> #include <iomanip> u...
[5 replies] Last: in line 16: j-- is the postfix decrement operator. which means it won... (by Esslercuffi)
NEED HELP WITH ANOGRAM
 
Write a program to solve word anagrams . Your program should 1) read in the file words.txt, 2) allow the user to enter a word or a string of letters ...
[no replies]
Adding to the size of a dynamic array of structures
 
So I'm trying to write a program that keeps an inventory for a store. The code that I'm struggling with is a function that is supposed to add a fish to the inve...
[7 replies] Last: I know you say you have to use an array instead of using a vector. But... (by XorioZ)
xcode help
 
my program isn't reading from a .txt file that i created can some tell me where i went wrong #include <iostream> #include <fstream> #include <iomanip> /...
[1 reply] : when i open files in Xcode i have to include the path, like so in_str... (by VanTate)
mod a floating point
 
Hey all So for my homework I'm trying to write a program to find if a user chosen floating point number could actually be stored as an integer. The problem i...
[5 replies] Last: You should check if the fractional part is close to zero, rather than ... (by Zhuge)
October 2014 Pages: 1... 89101112... 70
  Archived months: [sep2014] [nov2014]

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