Beginners - October 2016 (Page 18)

Why does this function allocating memory in a function not work correctly?
 
This code does not give me the expected data in mystr, I get "Unhandled exception at 0x012D2CE3 in Project1.exe: 0xC0000005: Access violation reading location 0...
[2 replies] Last: "Correct"? Debatable. Here is one: #include <iostream> #include <stri... (by keskiverto)
by Zorai
Help with this C++ exercise please?
 
Hello, I am working on some C++ exercises. I'm a beginner and having a lot of trouble moving forward with this one: "Create a coin-flipping game. Ask the...
[7 replies] Last: how much money they’ve won/lost If you do have $50 at start and en... (by keskiverto)
Adventure Game With Classes and Arrays
 
For my class project, I'm writing a choose-you-own-adventure game. It uses two classes (so I can show that I know how classes work): Scene and Option. It was...
[no replies]
Names - Reverse order - pointers
 
Hello : ) I have a problem with my C++ program. I don't know how to print first and the last name in reverse order using pointers. For example if user type: "Fi...
[2 replies] Last: Thank you very much for your help skaa ! I know how it works now. (by Rododendron)
Having trouble using range-based for loop in my code, won't compile?
 
I've been trying to use a range-based for loop in my code but my compiler tells me range based for loops cannot be used in c++98 mode. I went to settings > c...
[6 replies] Last: Never mind, I finally found a solution, downloaded a new compiler wit... (by Nelson108)
Bubble sort optimization - or not ?
 
Hi there. I'm trying to understand possible optimization methods for the bubble sort algorithm. I know there are better sorting methods, but I'm just curious. ...
[3 replies] Last: I did the test with 10 times more numbers and get now 19(no optim.), 1... (by Guzfraba)
Dungeon crawl
 
Having a lot of trouble with this problem don't even know where to start any help would be appreciated! The input to your problem is an ascii representation ...
[7 replies] Last: you would have to check every location maze and check the value. ... (by SamuelAdams)
How do I change the color of texts?
 
Hello! How do I change the color of the numbers that user enters? for example how do I make 16, 5 and 9 (Red, blue, yellow etc)? When you run the program, it ...
[13 replies] Last: I agree, a lot of bad code is written every day. But if he stays in p... (by SamuelAdams)
by mmgh
linking problem with xml2
 
Hello, I have a complicated cmake file and I want to compile my program with xml2 library. The cmake run finds the xml2 libraries and also its include di...
[2 replies] Last: It does not add xml2 library into build.cmake while other libraries ar... (by mmgh)
Reading in Data from a file, printing it then calculating the sum/ave/sc
 
Hi, I am vvv new to C++ and doing a course on it. The first assignment i have is to reading in and print out numbers from a file, then calculate the avearage of...
[1 reply] : These and others may need to be outside your loop. double total = ... (by SamuelAdams)
by rantiv
HotPlate simulation
 
Part 2 - Update Elements Once (25 points) The job of the algorithm is to find the steady-state temperature distribution of the interior elements which are co...
[1 reply] : I do not see any question. You cannot update array right after comp... (by keskiverto)
Map not properly identifing elements
 
The purpose of this thing is to allow the user to type in a name of an element and the program will search the database for said element and use the elements co...
[8 replies] Last: in general, is there a ball-park file size number beyond which would ... (by jlb)
Switch Class names
 
I am very new to programming and I need to have a way to switch between two different class names depending on a user input for a school project. Listed below w...
[4 replies] Last: A masochist would: void currF() { Tempature which; float inte... (by keskiverto)
by om4r97
store data in arrays of struct
 
hello every one . i want to put this text file data in arrays using struct , but i have some syntax and i didnt understant this , what i should study and can a...
[4 replies] Last: Line 52: Do not loop on ! stream.eof(). This does not work the way yo... (by AbstractionAnon)
Selection Sort/Bubble Sort/Insertion Sort
 
I have a code that doesn't have any compile issues. However, when I try to run it, it's not working. Any help would be great, I am fairly new to this. #in...
[no replies]
Accessing nested class function through Base classs Object
 
I have a class Called Cbros, and then a nested class called Wallet. There's a function defined under Wallet. I can access that function in main() through a Cbr...
[3 replies] Last: Make a variable: #ifndef CBROS_H #define CBROS_H #include <iostream> ... (by coder777)
Hangman Help
 
Hi. Can you please help me with this problem? If you can do it as soon as possible. Thanks. :) Use IF, loops, switch, and string statements to create a basic...
[5 replies] Last: #include <iostream> #include <string> it main() { std::string se... (by boost lexical cast)
by rantiv
Modify a vector parameter
 
Write a function SwapVectorEnds() that swaps the first and last elements of its vector parameter. Ex: sortVector = {10, 20, 30, 40} becomes {40, 20, 30, 10}. Th...
[3 replies] Last: You can condense the above answer by simply calling std::swap on fro... (by Arslan7041)
Bank Queue Simulation
 
Hi, I'm trying to learn more about classes/vectors/queues, so I've been playing around with code I find online. The code in question is from this site: http://...
[no replies]
October 2016 Pages: 1... 1617181920... 51
  Archived months: [sep2016] [nov2016]

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