General C++ Programming - November 2017 (Page 15)

Its a bug ??
 
#include<iostream> using namespace std; int main() { int a; cin>>a; cin.ignore(); int b = 2; cout<<b; return 1; } When I...
[1 reply] : So you type in the number 3, and the screen looks like this: 3 The... (by Repeater)
by ololo
How to change XML attribute value for a list of elements
 
Hi guys, I have a XML fragment where there are a lot of "Charge" elements. I need to change the value of the attribute "Amount" where Type="5" and Id="977" ...
[2 replies] Last: ... (by moribaki)
Need assistance with this simple program
 
This is my first ever OO program so please don't judge me lol. This program is meant to print out the area of a rectangle and triangle with the same width and h...
[1 reply] : Your classes aren't entirely correct. Better would be: #include <ios... (by goldenchicken)
Adding data from class objects
 
Hello all, I am having difficulty figuring out why I cant correctly add the "size" which is my member data for a Song class. heres the code #ifndef _PLAYLIS...
[13 replies] Last: No, should I get rid of one of them that isnt used? I just need to kno... (by markymark99)
HELP! Reverse loop?
 
Use a loop to pull in the sets of information. As you pull them off, print only the names, in the format Last, First. Next, use a loop to print information out...
[no replies]
Check subset,union,intersection,difference and disjoint between two arrays
 
#include<iostream> #include<string> using namespace std; int main(); char arr ; char arrA ; char arrB ; void UniversalSet(string U) { char a; ...
[1 reply] : Foo is a subset of Bar, if every member of Foo can be found from Bar. ... (by keskiverto)
Sorting and Display
 
//playlist.h: #ifndef _PLAYLIST_H_ #define _PLAYLIST_H_ #include <iostream> #include "song.h" using namespace std; class Playlist { public: Playlist(); ...
[10 replies] Last: while(input != 'X' || input != 'x'); this looks wrong to me. it loo... (by jonnin)
Make a subgraph from a Boost Graph Library(BGL)
 
I have a boost graph library that I define it as below: /// vertex properties struct VertexData { std::string label; int num; bool is_leaf=false; ...
[4 replies] Last: @Cubbi thank you. I understand your answer better. However, I decided ... (by Bruce34)
Understanding of code.
 
string choice; string str; cout<<"Do you want to encrypt or decrypt the message: "; cin>>choice; if(choice == "encrypt") ...
[1 reply] : int i; // spin through each character convert to number and add a s... (by Jaybob66)
I need help to write a program to generate digital waveform of a binary number.
 
none
[no replies]
i
 
lll
[3 replies] Last: i tried doing *ppAssessment.push_back(NewCw) Remove the leading * . ... (by coder777)
binary to ascii, ascii to binary.
 
#include<iostream> #include<cstring> #include<cmath> using namespace std; char bin_to_ascii(string bin); string ascii_to_bin(char ch); int main() {...
[4 replies] Last: @programnick I think you missed what I was saying. My goal is to conv... (by Chervil)
Need Root of Tree
 
This code works, but I need a function to locate the root of the tree (exp). Any help would be greatly appreciated. NodeExpression.h #ifndef NODEEXPR...
[7 replies] Last: > What about cloning or deep cloning? What do you think? Implementing... (by JLBorges)
by shamar
Help with a program
 
Hello Good night. I'm Beginner and I've received this program to do its due tonight and i'm still having problem doing it. Could someone help me please?? Wr...
[1 reply] : Duplicate: http://www.cplusplus.com/forum/beginner/224242/ (by TheIdeasMan)
Beeping function duration determined by key-pressed event
 
Hello, I'm currently learning C++ through Dev C++, and I'm working on an programme which with keyboard inputs generates sounds of different frequencies(music on...
[no replies]
Something weird happening with #ifdef
 
So I have this code: void TileButton::draw(Graphics *g) { #ifdef DEBUG_TILE_BUTTON g->drawRect(rect.x, rect.y, rect.w, rect.h, 0, 0, 0); #endif } And I ha...
[3 replies] Last: I have solved the problem now, thanks both for your help. (by goldenchicken)
Compare a string with quotation marks
 
The function strcmp does not seem to like quotation marks in a string. I'm using GNU C++ 5.x. Did I miss something? printf("%s\r\n", mystring ); // Output: "00...
[2 replies] Last: something is up. This simple program gives the expected output of 0 me... (by jonnin)
by Jakjam
Help with the char function
 
I must write a program that tells the user how many characters are in the string that they entered. But my pointer is giving me an error, telling me that it is ...
[3 replies] Last: Now with pointer use. #include <iostream> #include <string> using na... (by Repeater)
Help with a program
 
Hello, first time posting here. I have to make a program using arrays to get the highest score out of 10 games and the name of the game associated with the high...
[4 replies] Last: The only problem I see in that function getHighestCombined() is at l... (by Chervil)
binary tree and AVL tree unhandled exception
 
Hello, I am working on a tree and AVL tree program and I have everything done, but It crashes when run (no compiling errors) so i run it in debug through visu...
[2 replies] Last: I think the problem starts with binaryNode* head; binaryNode* h... (by Thomas1965)
November 2017 Pages: 1... 13141516
  Archived months: [oct2017] [dec2017]

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