Beginners - February 2014 (Page 55)

How to make a map with two keys?
 
I want to be able to search for just one key, like this: Sprite.at["Stone"] == Sprite.at Sprite.at["Grass"] == Sprite.at Is this possible, or sho...
[2 replies] Last: have you tried std::map(tree) or std::unordered_map(hashmap)? http://... (by Smac89)
How to deal with MSB?
 
#include <stdio.h> #define YES ("a palindrome") #define NO ("NOT a palindrome") #define CHECK(X) (is_binary_palindrome(X) ? YES : NO) int is_binary_p...
[8 replies] Last: (although I don't have stdbool.h) Here you go: /* Copyright (C) 19... (by Computergeek01)
Help, deck of cards
 
I am trying to set up a deck of cards that have two other arrays of type constant strings for ranks and values. I need to initialize the deck with two nested fo...
[1 reply] : I got it figured out so far now I just need to loop it: #include <io... (by Spector)
fstream not working. Same syntax as text book...
 
Ok, so I have to read from a text file. Some of the things we have to read are int values so I am using fstream to get them from the file. The information we...
[3 replies] Last: You say the information in the file is in the format: 2011 Chevrolet... (by Smac89)
Help with for loop
 
Print positive integers to the screen. These integers should be less than 100, and are the multiple of 3, 5 or 7. In your program, you use setw(4) in cout f...
[2 replies] Last: Try this: #include <iostream> #include <iomanip> using namespace std... (by SorinAlex)
Using Sort on a read file.txt function
 
Hello everyone! I am trying to use Sort function in my code. So I sort those lines from a file.txt in ascending order according to their price.. And if there...
[2 replies] Last: Thank you very much for the help! I am really grateful! (by DeathLeap)
Convert char to int
 
This weeks assignment has to do with using a convert char to int. My problem is I don't have the slightest idea why you would want to do that or what you would...
[4 replies] Last: Thanks everyone for your responses (by tdenning)
need help..by using arrays..
 
By using two-dimensional arrays, how i must write a program to read this Air Pollution Index (API) as an input from the user and store the data in a two-dimensi...
[1 reply] : Do you have any code yet? This forum is just for help, and will not d... (by kevinkjt2000)
Access violation in getline
 
Hi, it's me again! This time I have a error that occurs while running. I get access violation while trying to read from a file (It is created, and not blank!). ...
[4 replies] Last: Oh, got it! Thanks, and sorry for the slow reaction (i am very tired t... (by viper093)
Why is this so (1,2)
 
Why String size is less than the array of characters, Though both have same pharase #include <iostream> #include <string> using namespace std; int main...
[22 replies] Last: I've not coded it yet, I'm trying this in shuffling the Deck of Cards (by ButchCavendish)
Help!!
 
Hi, I'm making a currency Converter program for Uni and I just have 2 problems.. I have 2 Error's with this code 1: "IntelliSense Expected a 'while'" (I have...
[2 replies] Last: Okay Thank you so much! (by lukeyy33)
by Kay94
Handing a 2D-Array to a function as reference
 
Hi there, i'm trying to hand 2-dimensional-Array to a function as a C++-reference, so i can write to it and use the changed values in my main-function. But s...
[2 replies] Last: Thanks a lot, now i remember again! (by Kay94)
2d-array size passing problem
 
I'm doing a program that involves 2d-array and I'm having a problem on passing it's size because i want the program to read the first two integers in the .txt f...
[2 replies] Last: "int*" and "new "? do you mean dynamic array allocation using pointers... (by NoobProgrammer03)
something doesn’t make sense with the for loop
 
so this program should be getting values of x coeff for any polynomial of degree n then gives the value of it when substituting x with (0 , 1 , 2 ) I think tha...
[3 replies] Last: I got it :) I used the variable i twice that’s why :D (by YGilany)
Help with variable?
 
I am actually not sure where to put this, but I have kind of a problem. So if you see the code that I have #include <iostream> using namespace std; /...
[3 replies] Last: You're welcome. :-) (by MrHutch)
by zakkor
ClrScrn function using winapi not working.
 
Any idea why this clear screen function isn't working? I took the code from http://stackoverflow.com/questions/14295570/why-is-console-animation-so-slow-on-w...
[2 replies] Last: Fixed. The 'console' variable was not good. I needed to initialize it ... (by zakkor)
Finding Mode in an Array
 
I seem to keep running into problems trying to figure out how to get the mode... Any help please!! #include <ctime> #include <iostream> #include <cs...
[5 replies] Last: Hi @cluterbug1, this could be a start //Mode.cpp //## #include <i... (by eyenrique)
Suggestions From Advanced Scripters
 
Hi everybody. I am a beginner at C++ & Ruby. I've been watching about 20-30 videos in order for each language. Since I am very technology/math friendly, p...
[no replies]
(opengl, c++) Functions and data structures in a square and rectangle
 
Hi guys. I have a square at the top and a small rectangle at the bottom that can be moved through the the 'a' (left) and 'd' (right) keys. When I move the squar...
[no replies]
Word palindrome program
 
Our facilitator asks us to write a program that will determine if a word is a palindrome or not. It should use arrays and pointers. Heres my code so far c...
[3 replies] Last: Can you use iterators or just pointers? I think it would be easier to ... (by giblit)
February 2014 Pages: 1... 5354555657... 60
  Archived months: [jan2014] [mar2014]

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