General C++ Programming - April 2013 (Page 41)

Why does it print twice the same thing?
 
Hi, I haven't, am not and do not plan on learning C++, all I know is from forums or from a book I read two years ago. I am trying to make a program that calcul...
[1 reply] : Add std::cin.ignore(); after line 55. I can see other things you pr... (by fg109)
Dynamically allocated arrays
 
I have a program that allows the user to enter a specific number of test scores. Based on these test scores, the program should display the average score and ca...
[1 reply] : for (int i = 0; i >= numScores; i++) vs for (int i = 0; i < numSc... (by fg109)
Problem displaying correct HTML table.
 
Below is a link to my code. The problem I am having mostly is concerned with the void function at the bottom of the code. It is a function that writes the body ...
[no replies]
Best way to sort an array
 
This is the best idea og algorithm for sorting an array that I could come up with. But I read on internet that there are many other ways of strting an array, b...
[9 replies] Last: Ok, I'll use if else instead of template... (by zoran404)
Outputting Randomized Arrays
 
For an assignment I am having a user enter the name of a file that contains "Song Data" the file is set up like this: (example) 1012 C 3333 R 90 ...
[1 reply] : I don't know what 'chosen' and 'not chosen' mean. But you can use the ... (by eklavya sharma 2)
classes + constructors
 
#include<iostream> using namespace std; class polygon{ protected: int x,y; public: polygon(int a,int b) { x=a; y=b; }...
[6 replies] Last: @MiiNiPaa No, they don't, in sense of using it as their constructor.... (by vlad from moscow)
Test results program
 
Hi all, In a program that allows a user to enter a specified number of test scores, how would I create a function that calculates how many of the scores were...
[3 replies] Last: @codenewb54 I'm so confused. I don't know how to create the function.... (by vlad from moscow)
How to append strings to the front of other strings?
 
I am programming a translator, and I have it so that it detects words with spaces both in front of and behind them, so I did "string.append(space);" where space...
[1 reply] : yourstring = " " + yourstring + " "; (by Disch)
Help Changing Array Of Characters To A String Array
 
I have an array titled: char TypeOfSong where the array size is 15. I am reading data from a file into this array and the characters can be either 'C', 'D', 'E...
[5 replies] Last: It will contain pairs 'C', std::string( "Country" ) 'D'. std::string... (by vlad from moscow)
Overload << Operator with Input Parameter
 
Hi, Here is what I am looking to do: // class constructor as log file input Logger log(file_name); // input argument as the log level // stream overlo...
[4 replies] Last: Again, thank you very very much for the help. It does work now as memb... (by vezprog)
Problem with comparing strings
 
Hello, i have a problem with comparing 2strings... I made a database program using files. I have a problem when i want user to search for a persons name from t...
[3 replies] Last: @En3rgy16 Please, enter any book on C++ for beginners and investiga... (by vlad from moscow)
Programming a USB A male to A male cable
 
I would like to try out programming a file transfer program by connecting 2 computers using an A male to A male cable. Is it possible, and if so how? Please kee...
[1 reply] : Bump. Nobody? (by lazyCrab)
by Rousan
Use switch structure nested in sentinel¬-controlled while loop.
 
can anyone please write aprograme that does the following: please!!!! In a CS115 Café there are three drinks to order (coffee, juice, and tea), write a ...
[no replies]
Question about test scores program w/ pointers
 
Hello all, I have created a program that allows for a user-defined number of test scores as input. After the user enters these scores, the program calculates...
[2 replies] Last: Yes, but how do I create a function that can determine exactly how man... (by closed account 3UMLy60M)
How do I overload variables in derived classes?
 
Is it possible to overload a variable in a derived class? Example: struct Circle { int radius() const { return r; } private: int r; } struct S...
[7 replies] Last: @benbalach Everything works! How does the line of code above work exa... (by vlad from moscow)
self object
 
Can a C++ class have an object of self type?
[11 replies] Last: Simulate a null reference via an exemplar. #include <iostream> #incl... (by JLBorges)
by SeBeQ
Free() problem, app crash
 
Hi everyone! I get problem with code from tutorial NeHe OpenGL int LoadGLTextures() { AUX_RGBImageRec *TextureImage ; //Pointer /* ty...
[2 replies] Last: Thanks for reply I will choose another library with different functio... (by SeBeQ)
How many times do you usually need to compile?
 
In a scenario where you wanted your program to work on almost any PC with an OS no older than Windows 2000, how many times would you likely need to compile your...
[4 replies] Last: for as long as my compiler doesn't give me errors. For easy errors to ... (by DeXecipher)
Basic Program to take an integer and returns 0 and 1s of that digit.
 
Create a Program That will take an integer and return a certain amount of 1 and 0's depending on the number of digits of the integer. For example, the output s...
[no replies]
by jh79
Saving and Recovering a file named by an user-entered parameter
 
I'm currently using C++. Need help in the following, 1. How can I save a text file using a parameter which the user entered? For example, the user enter...
[1 reply] : 1. Use cout (http://www.cplusplus.com/reference/iostream/) to get u... (by tcs)
April 2013 Pages: 1... 3940414243... 53
  Archived months: [mar2013] [may2013]

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