General C++ Programming - February 2014 (Page 6)

Storing values in arrays
 
I'm am trying to get info from a file and put it into three arrays but it isn't working and I have no idea what is wrong. #include <iostream> #include <fstrea...
[3 replies] Last: Size of stack allocated arrays should be known at compile time, i.e. y... (by MiiNiPaa)
by IGI30
How to print '*' while entering a password
 
I've created a program to input a password but while printing it it contains garbage value. What is the reason behind it and is there is any way to solve it. ...
[4 replies] Last: Ok thanks next time will take care of this (by IGI30)
My Tic-tac-toe program
 
Hello folks ! This is my first post here and I'm sort of a beginner in C++. Learnt the basics in my junior year and am on my way to senior ! Here's a tic-tac-t...
[4 replies] Last: I shortened the code using another logic but has the for loop similar ... (by Guessit)
by meesa
[C++] Set Precision with floating point numbers
 
I'm displaying a table of floating point numbers with setprecision(5) . If the number is "1.25" it will display "1.2500" which is what I want. However, if the ...
[1 reply] : 1) setprecision will not show trailing zeroes, you are probably have ... (by MiiNiPaa)
I need help from anyone on my program
 
I would like to add this cout << "PRESS E TO EXIT THE PROGRAM " << endl; right after cout << "C\t\t$19.95\t\tUnlimited\t\tUnlimited" << endl; That way th...
[5 replies] Last: Don't worry about it. There is no reputation system here; the admin ju... (by Zhuge)
problem with eofbit(), failbit() and badbit() functions.
 
int errorCount=0; ifstream welcomeFin("Welcome.txt"); if(!welcomeFin.good())// good() return true if I/O is ok. { errorCount++; ...
[2 replies] Last: thanks (by Ahmad1797)
Sorting arrays alphabetical
 
I need to sort the array alphabetically but I really do not how. I tried to do it below but it didn't work.Any help is appreciated. #include <iostream> #incl...
[6 replies] Last: Nevermind I got it, thank you for your reply though! (by alyssnyx)
by Sika
How to pass same instance of object in two function in c++
 
I need to send same instance of object of a class in two function (Main function and thread function) The class is something like this: //The class nee...
[1 reply] : Pass obj as an argument to F1. Since F1 is your thread entry point, th... (by Zhuge)
Binary Tree Insertion: setting parent
 
I need to set a parent for each new node being inserted but I can't get to incorporate that into my insert function. Here's a part of my code: struct bst...
[2 replies] Last: thankyou so much. I've managed to do it. now I'm wrestling with delete... (by ahmadsbokhari)
My Project for Finals
 
1.)Using Turbo C++ write a program that will accepts a string and output the words per line.For example an input of The World is beautiful will produce ...
[6 replies] Last: .these help a lot... .maraming salamat! . (by csce21 carlo)
is thinking in c++ necceserry?
 
hi, well i started reading thinking in c++ when i comeback from school im sleepy its hard for me to read i read over and over to understand:D but i read till 1...
[6 replies] Last: Thanks so much:) ok i will skip over and read new things also i will r... (by kam hagh)
Mode
 
I needed to compute average median and mode for numbers in a vector. Im having a few issues I have already figured out how to calculate average and median just ...
[7 replies] Last: Im trying to get the mode of the movies if there is any when the user ... (by Pierreseoul)
by Croug
Non-VS Glut/freeGlut OpenGL Tutorial
 
I've looked all around for a glut tutorial but I keep finding ones that require Visual Studio, I would like a tutorial that does not depend on VS or the VS libr...
[2 replies] Last: Thanks! (by Croug)
structure naming syntax
 
I am looking at a linked list example, which uses structs: typedef struct node { int val; struct node * next; } node_t; As you can see, we pr...
[4 replies] Last: You have to look at this from the outside in. The first statement y... (by doug4)
Graphics Problem
 
i am using graphics feature of c++, while using inbuilt rectangle example it shows error which will remove after "initgraph(&gdriver, &gmode, "D:\\TC\\BGI");" ...
[5 replies] Last: I recommend using SFML. (by LB)
Distributing a quantity r in m boxes
 
I will make a mess of explaining this, but I'm stuck.. I have an array of size m and r resources. What would be an efficient (or just any) way of distribut...
[3 replies] Last: @ats15 Yes you're right, I didn't realize that even putting all the re... (by nname552)
by IGI30
Why we use namespace std
 
My question is that why we use "using namespace std;" in Visual studio for "cout" while in Turbo C++, DEv it is not required.
[3 replies] Last: [quote=Standard] 17.6.4.2.1 Namespace std [namespace.std] 1 The be... (by MiiNiPaa)
I need help with homework.
 
For the following problem turn in both an algorithm and a program along with output. 1) Write a program where the user has to enter any single character from...
[1 reply] : What does " The program will also display the next two characters imme... (by MiiNiPaa)
Height or Depth of Binary Tree
 
hi, i'm in interested to know what will be the height of binary tree with say 5 nodes (consider it balanced) is it 2 or 3? 9 ...
[6 replies] Last: thanks keskiverto. (by spskhokhar)
the shellsort algorithm
 
Below is an implementation of the shellsort algorithm I got from the book: void shellsort(int v , int n) { int gap, i, j, temp; for (ga...
[3 replies] Last: > when gap is 5, we only swap elements once, > we do no comparisons w... (by JLBorges)
February 2014 Pages: 1... 45678... 33
  Archived months: [jan2014] [mar2014]

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