General C++ Programming - April 2016 (Page 21)

Code for menu using potentiiometer and button
 
I have a button, potentiometer, LCD and a K64F board. How do i go about making a menu that the user can scroll through using the potentiometer and select with ...
[no replies]
Class template for stack in C++
 
Here is the original requirements: Write a class template for a linked-list implementation of a stack. The stack class must have the push, pop and isEmpty func...
[2 replies] Last: You might want to try this as a test case for your code. int main() {... (by doug4)
using ## in define
 
on the 'if' line, i get error : Undefined symbol 'si' but i want it to use the value of 'i' not the variable name typedef AnsiString aStr; bool SelectCase(...
[3 replies] Last: here is the rest of the code #define SELECTCASE(sMainStr) { AnsiS... (by sergelac)
Making Program Compatible
 
I currently have a main.cc and a database.cc file that work perfectly, but my main.cc file does no match the one that is going to be tested. I've tried to conve...
[4 replies] Last: I see you took my advice from the other thread and make a separate Fli... (by AbstractionAnon)
2 dim array I/O files
 
So I am attempting to write a program to read from a file that is layed out like so: Name 0.0 0.0 0.0 0.0 0.0 0.0 Name 0.0 0.0 0.0 0.0 0.0 0.0 and have...
[1 reply] : You need a second getline() probably before the second loop. (by coder777)
by norcal
Help: Rock, Paper Scissors Game
 
Here's the assignment: http://www.rdb3.com/python/exercises/7.8.pdf I dont know what im doing wrong. #include <iostream> #include <cstdlib> #include <ctime...
[4 replies] Last: int userscore,compscore; userscore=0; compscore=0; Move this code o... (by Thomas1965)
How do I get a variable to recalculate with every iteration of a WHILE loop?
 
I'm trying to create a counter that increases in increments of two in the first column and then also increases in the second column with the numbers in the firs...
[1 reply] : timeCalc = 0; (by SamuelAdams)
by a10e29
Mismatched Signatures???
 
Hi, class Foo { public: virtual void baz(void*) = 0; }; class Bar : public Foo { public: void baz(Qux*); }; I have the feeling this isn't going to work ...
[2 replies] Last: Good answer. https://en.wikipedia.org/wiki/Precondition In the pres... (by a10e29)
out of range, no error
 
I am trying to force an out-of-bounds error and cannot. Can some one please tell me why this is occurring. For the first array-for each combination there is no ...
[2 replies] Last: "aha" Thx (by technologist)
Big int adding problem
 
I have a problem in adding the 2 big int that i cant adding the different length integer. can someone help me? Here is my code: #include "LargeInt.h" #inclu...
[1 reply] : try to use the code tag to quote your code, it will make it look much ... (by ZeroStart)
vector index.
 
if i have vector<string>player_0={"DK","DJ","D9","D4","H2"}; and D is for the suit of diamond H is for Heart. how do i write a for loop to check if the player_0...
[4 replies] Last: bool all_cards_of_same_suit( const std::vector<std::string>& cards ) ... (by JLBorges)
question mark
 
how to make a program where the users type "?" and the program says you have typed a question mark?
[2 replies] Last: its working. Thankyou. (by riyadhhossain01)
[C++] How exactly would one initialise a vector which is being created by a forward declaration?
 
Trying to create a vector of cSquare however I am having difficulties as the class states it needs to be initalised? How would one go about doing that consideri...
[4 replies] Last: // using namespace std; // avoid in header files class cPlayer { /... (by JLBorges)
problem with long integer multiplication
 
I am trying to multiply two user input numbers ranging from to 18, but the problem is that i cannot use long int, or string to take the input. I am basically s...
[1 reply] : Somehow I don't understand your problem. If all you need is to get the... (by Thomas1965)
Display and Save Linked List
 
I have numerous functions written to implement on a linked list of objects. All I have left to write is the display() and the save_to_file() functions, which ar...
[4 replies] Last: Option 3 by the way would look like this: Add a function declaration i... (by Chervil)
by ketnav
Caesar
 
Hi guys, I have written a "Caesar cipher" code but I've been stuck since 2 days trying to work out why the section of my code that is supposed to increment the ...
[2 replies] Last: For each character you loop through all letters in the alphabet. When ... (by Peter87)
by ketnav
Caesar
 
Hi guys, I have written a "Caesar cipher" code but I've been stuck since 2 days trying to work out why the section of my code that is supposed to increment the ...
[2 replies] Last: Please don't double post. http://www.cplusplus.com/forum/beginner/1881... (by integralfx)
[C++]Using Heading Guards But Still An Identifier Error
 
Wanting both cPlayer and cSquare to be able to know about each other but I do not want both includes to mess each other up. I have *learnt* about heading guarde...
[3 replies] Last: It's just a pointer so the compiler only needs to know that cSquare is... (by Peter87)
Check to see if a file has content inside
 
What would be an easy implementation of reading a file to see if there are contents inside for a beginner?
[1 reply] : inline bool has_content( const std::string& path ) { return std::ifst... (by JLBorges)
Clock() vs time() vs std::chrono::high_resolution_clock
 
I believe that chrono::high_resolution is the more correct and modern way of measuring time with C++ whilst clock() and time() are the old ways of getting/measu...
[16 replies] Last: Just define _CRT_SECURE_NO_WARNINGS and these warnings would go away.... (by rabster)
April 2016 Pages: 1... 1920212223
  Archived months: [mar2016] [may2016]

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