Beginners - July 2015 (Page 21)

Visual Studio
 
I have spent the last 7 hours trying to get the SDL library to work for my Visual Studio. And I have seriously tried everything and I feel so hopeless. I've loo...
[4 replies] Last: Step by step tutorials here - from setting it up in Visual Studio to p... (by shawnlau)
If statement help.
 
Ok So I need help with the very last part of my code. Basically what the overall code is supposed to give an average age of the family members then display whic...
[5 replies] Last: else if (stateArray != "texas" || stateArray != "Texas") That will... (by Ganado)
Code::Blocks CRASH!!!
 
I have a huge problem with code blocks. Recently, I uninstalled code blocks. I couldn't find the application of Code blocks under "Uninstall a Program" in Co...
[5 replies] Last: I tried deleting default.conf, but now it says the compiler that was p... (by TheToaster)
my count_if() implementation doesnt work
 
Hi, I'm having trouble understanding 1 thing so here it is! 1. I created my count_if function template<class Iter, class Pred> int count_if(Iter begin, ...
[3 replies] Last: Ohh, thanks guys so much :) (by etrusks)
get() is reading double digit as individual digits
 
For example: 1, 5, 12, 8 val1 = f1.get(); f1Vector.push_back(atoi(val1.c_str())); It's reading the single digits just fine, but for some reason, the 12...
[1 reply] : The get() function reads one character . If you want to read numbers... (by Peter87)
by tcanna
Geologic Time (enum)
 
I am working with Visual Studio 2010 and I am getting error codes for the equas sign indicated in the comments with all capital letters and I would love help kn...
[10 replies] Last: So, I finished it off and I used a random number generator so it can p... (by tcanna)
by tcanna
Battle ship, trouble compiling know where, not why
 
I am having trouble getting this code to work and it is only one line that stops it from compiling but that one line sets my ships and that is crucial. Any thou...
[6 replies] Last: Ok, so it works. Is there a way to label my columns as letters, I know... (by tcanna)
sorting arrays from top-down
 
Hello everyone, I just wanted to thank you all for all the help I have gotten from here. When I know more about programming I will pass it forward. Problem:...
[5 replies] Last: Thank you. I might try and do a new post so people don't get confused.... (by jpanther)
by Kenota
Writing code for Rock, Paper, Scissors game.
 
So I've been teaching myself to code for the past three days and have hit a road block in my code. When I run the code it only executes one of the outcomes rath...
[1 reply] : Why main() at 84? I don't think main() can call itself or should call ... (by CodeWriter)
Sorting two arrays (parallel) question.
 
When I run my full program, array1 sorts perfectly. However, the values that go along with array1, which are stored in the same location in array2, don't change...
[3 replies] Last: What happens if, in the second code you say works, you change, if (m... (by CodeWriter)
Copying an array into another array but in reverse
 
I have another program to write where i need to copy the contents of one array into a brand new array but in reverse order. I am suppose to use pointer derefere...
[4 replies] Last: I see that makes sense. I appreciate you helping me with all this! You... (by kingkush)
by agda
Why doesnt this program Work?
 
Write your question here. #include <iostream> #include <string> #include <time.h> using namespace std; int main(){ srand(time(NULL)); i...
[3 replies] Last: #include <iostream> #include <cstdlib> // YOU NEED THIS #include <s... (by CodeWriter)
How do i let the user determine the size of an array?
 
I am trying to write a program where the user can determine how large to make the array but i keep running into problems. Particularly my last line of code is g...
[8 replies] Last: using std::cout and std::cin are more specific and clearer than u... (by vickoza)
Hangman - trouble with strings
 
I have just begun programming, and I thought I would try my hand at making a very basic game of Hangman. The particular sequence I'm having trouble with is: ...
[1 reply] : strcmp compares strings (char*). And it looks like you are trying to p... (by MiiNiPaa)
Questions about a pre-defined piece of code
 
I hope my question fits the forum and, if it does not, please let me know and I will kindly look for another place to ask. I have to write a C++ program based ...
[2 replies] Last: (1) is an constructor with an initialisation list (the preferred way t... (by mutexe)
Why does this program work?
 
The program in question is the following: string text = {"one", "two", "three"}; string * pText = text; cout << ptext << endl; // address of t...
[9 replies] Last: Assumes rather than knows. "C-string" is a convention that a char* p... (by keskiverto)
Multidimesional vector constructor question
 
Why doe this work and the next one cause an error? #include <vector> #include <iostream> using namespace std; class foo{ public: vector<vector<int>> m_ba...
[9 replies] Last: in the second constructor in the post above, the parenthesis represen... (by MiiNiPaa)
Scope Handling Ideas
 
Hello, I'm writing my own file format (for a small personal project). I've looked at many different types of file structures and I've decided that I wanted to s...
[2 replies] Last: Thanks for the idea about stacks. I can't believe that I forgot about ... (by MaxterTheTurtle)
Assigning iterator and integer in same statement
 
Why can't you declare and assign an integer with an iterator using the comma operator? #include <vector> #include <iostream> using namespace std; class f...
[2 replies] Last: You're right. You can only declare one variable in the for statement, ... (by shawnlau)
Size of char array decided by user input?
 
I want to declare a char array with not initial size. Later I will prompt the user to enter in a sentence. This input will be stored in the char array using get...
[15 replies] Last: 2. Just the string (using index-based instead or iterator-based access... (by andywestken)
July 2015 Pages: 1... 1920212223... 33
  Archived months: [jun2015] [aug2015]

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