Beginners - May 2016 (Page 12)

Debugging binary search in a vector
 
I have some code where I am attempting to build a vector and keep it in order by name. When a new planet is added, I binary search by name and then slide every...
[2 replies] Last: Never mind, I solved it. In BinSearch I needed to add after line 250:... (by klearner)
by ckh96
Frequency Function
 
I need to write a frequency function in order that numbers don't repeat when output vector 3 and common elements unless it shows up in V1 and V2 twice. Such as ...
[1 reply] : //lists common elements of V1 and V2 vector<int> common_elements(vec... (by Thomas1965)
Classes and objects with variables problems
 
So I'm new to classes and trying to figure it out. I can't seem to get it to work with regards to the objects in main. Can somebody explain or show how it shoul...
[1 reply] : Hi, You need to qualify your function definition names with the clas... (by TheIdeasMan)
by opengl
boost.asio echo client crash
 
According to the async_tcp_echo_server.cpp from here http://www.boost.org/doc/libs/1_59_0/doc/html/boost_asio/examples/cpp03_examples.html I made a client to...
[6 replies] Last: hi Cubbi I think I found the tricky boost::asio::async_read(socke... (by opengl)
calling a function in void?
 
Hello World! Very new to the intriguing world of C++. Loving the struggle so far however ran into a road block. My assignment is to create a complex class wh...
[3 replies] Last: Thanks sooo much! I will think your replies through and come right bac... (by graymats)
Sorting Random Vector
 
Hello everyone, I am trying to write a program that sorts a vector's 100,000 random integers from least to greatest. I am using C++'s standard library functio...
[11 replies] Last: Not really random, but more than random enough for our purposes (shoul... (by JLBorges)
What's the best way to edit words in an input sentence?
 
Let's say the input is "My name is Michael, and I am 36 years old." I'm using getline(cin, str) and then looking for spaces to be new indices to create substrin...
[2 replies] Last: Since that your input is cin, which is a stream buffer, you can use th... (by Tyler T)
Pushing Class Member Function Pointers Into A Vector
 
I cant seem to figure out how to accomplish this... I have a class containing a vector of functions pointers, of which, I would like to point to specific cl...
[no replies]
Trouble with Arrays
 
How do I go about putting a users input into an array? I'm trying to hold 10 test scores and use a function to figure out the perfect scores (100). Right now I ...
[19 replies] Last: Gosh C++ is difficult to grasp. Thanks for the link, I will read up on... (by closed account 3voN6Up4)
by salah
count the number of even, odd, and zeros in digit
 
plz need help with this code(urgent) #include<iostream> #include<cstdlib> #include<ctime> #include<iomanip> #include<cstdlib> #include<cmath> #incl...
[3 replies] Last: @PBachmann Make sure you use comment blocks if comments are long! ... (by closed account 3voN6Up4)
asking for guidance about game programming
 
hello, i've never wrote a thread like this before, so i hope you enjoyed the title x) i know that i'm doing something wrong, since i'm not using c++ as a lan...
[9 replies] Last: @dhayden I'll check that out too! I didn't know that! Thanks! :) (by SonDavid)
by stav
detecting os during runtime
 
how do i go about detecting the os during runtime rather than compile time? (so that i only have to compile one program and it'll be able to run different code...
[1 reply] : Do you mean different versions of the same OS? You can't, generally sp... (by helios)
tolower() not working
 
If I input "2 Bad Dogs", the correct output should be "2baddogs", but instead, I get "2BadDogs". Any suggestions?
[5 replies] Last: Thanks guys :) (by mistersunnyd)
CStrings
 
I tried to compare 2 CStrings but it doesn't seem to work : char i ="hello"; char f ="hello"; if(strcmp(i,f)) { cout<<"Yes"<<endl; } else { ...
[1 reply] : No, strcmp() returns one of three values, greater than zero, zero, les... (by jlb)
Codeblocks problem
 
Hi guys what I'm trying to do is access the .exe part of the file i go into the directory then bin folder then select the application but when I click and run t...
[1 reply] : Stickied post at the top of the fouum. http://www.cplusplus.com/forum... (by AbstractionAnon)
Input file cannot be opened
 
Hello guys, I'm doing a mini project about student admission data and currently my "case c" and "case d" is not running properly. Means the name and Id I try to...
[1 reply] : lines 126-128,142-144: You're swapping only the student name. You ha... (by AbstractionAnon)
my sorting program doesn't work
 
Problem solved!
[6 replies] Last: Please don't delete your post. It makes this thread useless as a lear... (by MikeyBoy)
by Tcm
'std::bad_alloc using boost library odeint
 
Hi I am new to c++ and boost but i was asked to solve some ode's. I tried using a stiff method, it compiled but when i run the program it says terminate cal...
[3 replies] Last: How can I initiate the calculations from x = 20e8 and x = 0.1 ? Use... (by coder777)
Manipulating the Console Screen (Confused)
 
Hey guys, basically I have to write a program that makes the word "DOWN" appear at the top (near middle) and the word "UP" at the bottom (near middle) and when ...
[1 reply] : A few suggestions. 1. a) Use functions rather than repetitive code. ... (by Chervil)
by ckh96
Vector Functions
 
I am trying to write a void function that outputs my vectors into my main. I have the following code for the function, however it says I have an error on my cou...
[1 reply] : #include <iostream> #include <vector> #include <cstdlib> #include <ct... (by JLBorges)
May 2016 Pages: 1... 1011121314... 36
  Archived months: [apr2016] [jun2016]

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