General C++ Programming - November 2016 (Page 14)

by nu123
code to multiply decmils only
 
hi there I'm trying to write a program that will only multiply the decimal in the number i enter by 9. so for example if i enter 2.345 the program will only mul...
[7 replies] Last: I do not think anything is wrong with @texasbeef results. He was showi... (by rghrist23)
in need help with accessing data members from an array of structures using pointers
 
# include <iostream> # include <fstream> const int SIZE = 20; using namespace std; typedef struct student { int stid,t1,t2,t3; float avg; }s...
[no replies]
Linking error on overloaded operator<<
 
I have been writing a small static library with a Jeton class. This class has an overloaded operator<<. Here is the code: In Jeton class: Jeton.h: namespace...
[14 replies] Last: @JLBorges: Brilliant! Thank you (by gunnerfunner)
dynamic memory allocation!!! problem
 
Hello , As I am using pointers member variables in my code , I had to create a dynamic memory allocation . But when i tried to delete the allocated memory spac...
[3 replies] Last: XYZ::method_xyz has a default argument for its only argument so that... (by cire)
dynamic memory allocation with multidimensional array
 
How can i create a multidimensional array for more than 3 dimension like below: int dim1, dim2, dim3; dim1=10000; dim2=99; dim3=9; #define s(i,j,k) (array[dim2*...
[10 replies] Last: actually i was trying to use p0() as 9d array at minimum, but if it i... (by lastchance)
C++ Class function and vectors
 
Hello everyone, currently I am taking a C++ class and we have an assignment based on the class and vectors function. I'm having a difficult time figuring out ex...
[3 replies] Last: Are you using pseudocode and flow charts in your class? This is where ... (by texasbeef)
Reversing strings
 
I am trying to reverse a string using pointers and no library functions. I see a couple of videos, but they seem to favor C, not C++. My code fix has to be some...
[5 replies] Last: Looks ok. A slight variation on your code, does the same thing. #incl... (by Chervil)
Code Blocks: can i add the #include "stdafx.h"?
 
can i add the #include "stdafx.h" on Code Blocks? using 'afx_msg' i can create functions for use the '::' on global section(correct me if i'm wrong): afx_msg...
[4 replies] Last: "The behavior "test" belongs to the class of a type, not to an individ... (by Cambalinho)
storing bunch of words in a string,
 
how do i store 5 words in a single string? and output it as a single string? like for example, jake blake hen for luke then store this 5 words in sam...
[4 replies] Last: Then use the middle example from Thomas1965 above. That is, make use o... (by Chervil)
by Skrapi
Can someone help me please?
 
UNIVERSITY REGISTRAR’S DATA ENTRY MODULE FOR COLLEGE ADMISSION Introduction The Registrar of Don Mayon University has been experiencing problems in generati...
[1 reply] : Can someone help me please? What part of the program are you doing ... (by Mantago)
Read text file into a map
 
Hello, I am trying to read 3 different text files into a map to store an int and a string stored in the files but I am not sure how to do so
[1 reply] : What are the contents of the three text files? Have you started to wri... (by Brigavo)
Will be header included 2 times if I include another header which contains same header?
 
Will be header included 2 times if I include another header which contains same header? Example code: main header: #ifndef MAIN #define MAIN #include <str...
[5 replies] Last: No; the problem is already solved for standard headers. See JLBorges'... (by mbozzi)
Please Help !! 1D Array
 
Hi guys i had problem with my code ==" i want my program to input 1D array and check if there is 2 Elements of the array has the same Value , if there is then ...
[2 replies] Last: Wild Blue Thank You very much it Worked =D #include <iostream> usi... (by killuakun)
Any good books that teaches card games?
 
Hey everyone, does anyone know of any winAPI books out there that teaches how to develop simple card games like Solitaire perhaps? I want to create my own colle...
[7 replies] Last: @Maima Van Persie Can you share your solitaire game? I would like to s... (by Brigavo)
by NICE8x
Some Questions on ifstream Function
 
My first question is should I put name or name2 in the while loop (). How do I clear drawer like it asks? When I try to print the first character and then pri...
[2 replies] Last: My first question is should I put name or name2 in the while loop ().... (by Chervil)
Pseudo code question
 
What does <> mean in pseudocode? Thanks. For example while(something <> 0)
[16 replies] Last: > Would this pseudo mean to multiply by 20%? temp = dollars % 20 I... (by JLBorges)
Nested function call and references
 
vector<int> decompose( string& number, bool& is_neg ); void print( const vector<int>& vec, const bool is_neg ); int main( ) { for( string num{}; cin >> n...
[3 replies] Last: The order of evaluation of function arguments is unsequenced (until C+... (by mbozzi)
by NICE8x
Would this work?
 
Basically I am taking in a line of code and we are supposed to use fail state to figure out which kind of format the line will follow. It will either follow on...
[1 reply] : An input stream enters fail state if (a) input data is invalid, (b) st... (by gunnerfunner)
Multiplying two matrices
 
Keep getting error message: error C2678: binary '*' : no operator found which takes a left-hand operand of type 'Matrix' (or there is no acceptable conversion)....
[11 replies] Last: :) (by closed account 48T7M4Gy)
Help w/ count from input file
 
#include <iostream> #include <fstream> using namespace std; int main() { ifstream, inputfile, inFile; int num = 0, sum = 0, count = 0; double average; ...
[6 replies] Last: Thank you for the help. Switched the variables around and is working c... (by ret squid)
November 2016 Pages: 1... 1213141516... 23
  Archived months: [oct2016] [dec2016]

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