Beginners - December 2016 (Page 25)

by roots
push_back()
 
I am having trouble writing the push_back() function. I am not sure how to assign the value parameter to the last or new space in the vector. #// Simple...
[4 replies] Last: template <class T> void SimpleVector<T>::push_back(T t) { // Alloc... (by roots)
Sorting vector by number using bubblesort.
 
Hello, I am trying to sort my student list by mark using bubble sort. The program runs but it is not sorting by mark. Thanks. #include <iostream> #...
[1 reply] : void sort(vector<records> record) This will pass the argument by val... (by integralfx)
Pointers and array paramters
 
Hi, I have a question related to this topic because I am doing a homework assignment and want to make sure that my understanding is sound. I have a function ca...
[1 reply] : My question is, how is this working? Realize that the following are... (by jlb)
Why does it run again after finished main function
 
I am practicing C++. The task I am coding is below. It is just a simple task to save capital letters from a string. By setting breakpoints, I make sure that eve...
[3 replies] Last: I solved, but don't know why.... I go to Debug menu in Xcode, clicked... (by landlord2017)
Priority Scheduling with arrival time
 
I'm trying to implement Priority Scheduling algorithm but with arrival time is giving, that do the first job first but take into consideration the priority of t...
[no replies]
code to determine whether the matrix is symmetric or not but either ways it give me symmetric
 
I have question I wrote that code to determine whether the matrix is symmetric or not but either ways it give me symmetric and I see nothing's wrong ...
[2 replies] Last: ooh thank u that was helpful (by sheeman)
Explanation cin
 
Can you guys explain what the difference is ? Thanks std::getline(std::cin, input); std::cin >> input;
[4 replies] Last: Also, std::getline() is better for strings. (by boost lexical cast)
Trouble with string arrays (1,2)
 
This is for an assignment. How do I split up the first array (names) into the two other strings (last, first) without initializing the latter two? #inclu...
[20 replies] Last: Well at least you two get to share the substantial prize money. One sm... (by closed account 48T7M4Gy)
Auto press W
 
I'm playing a game and I have to walk for a while. I have to press "w" for like 15 min and I would like some code to solve this. I've tried sendkeys but t...
[5 replies] Last: Well, you could use <windows.h> but it isn't portable. (by boost lexical cast)
by ryard
Please Help ME
 
how can I write the algorithm within using array example: a = 1 2 3 4 b = 8 2 3 5 result c = 0 1 //when element a=b result=1, e...
[2 replies] Last: first, create two arrays to accept the different inputs, then you loop... (by Aceix)
auto with no type error
 
Hi there, I am writing a program which removes any word which appears more than one time after sorting a vector but i have been constantly facing the error tha...
[2 replies] Last: Is your compiler compatible with C++11? The keyword 'auto' changed its... (by Chervil)
by SimonB
Why is it only working for small ints?
 
Hey guys, just started programming again and got a question about my code. I was doing this exercise: Write a program that asks the user to type the value of N ...
[3 replies] Last: Another angle on this. A cheap pocket calculator can give a result for... (by Chervil)
Just asking for guidance
 
Your goal is to implement an application that reads a file, modify its content, and writes the modification back to the same file. The file includes 3 lines of ...
[2 replies] Last: I got the code you were handed to run. Now it's your turn. Tip: don't... (by closed account 48T7M4Gy)
by TeeWee
Setting up array struct help for function
 
receipt takes an array of Items as its first parameter, and an int as a second parameter. The second parameter specifies the number of elements in the array ...
[2 replies] Last: There are a variety of ways, this is one. ( As a suggestion I would ... (by closed account 48T7M4Gy)
Unresolved External Symbols
 
So average stuff going on with me trying to figure out the errors I've got and then I got a new error saying there were unresolved External symbols. Any ideas> ...
[4 replies] Last: That did solve it...so yea this was me being stupid and not commenting... (by moosyman)
How to Capitalize a String for Comparison
 
I have a program where the user types in a name and the program reads a file with a list of names and compares it to the name the user inputted. If the name is ...
[5 replies] Last: There's an overloaded version of toupper() that uses std::locale #i... (by gunnerfunner)
Lo Shu Magic Square
 
I need help with the class definition and methods at the end #include <iostream> #include <iomanip> #include <cstdlib> #include <fstream> using namespa...
[no replies]
by wolfv
"has no member named ..." compile error
 
I am new to vectors and this example get compile error on line 28: #include <iostream> #include <vector> struct Map { int rowCol; }; struct Row { s...
[7 replies] Last: You are right keskiverto. And that is exactly what Akimov's solution s... (by wolfv)
*** glibc detected *** error
 
I'm fairly new to C++ and i've just recently gotten an error I'm not very familiar with. I'm working on a project that uses fltk and my professor created a kind...
[1 reply] : The error is trying to tell you that a routine in the GNU C runtime li... (by mbozzi)
srand
 
Hello there, i have an problem with my code, i use an random generated number from 1 to 19 with this code (see under) but what is the problem here, it will gene...
[2 replies] Last: Oh, im soo stupid :P Thank you man! (by CosminPerRam)
December 2016 Pages: 1... 232425262728
  Archived months: [nov2016] [jan2017]

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