Beginners - January 2018 (Page 7)

Random Number Generator Error
 
The following is my code, I have the GetProduct function down, I believe I possibly have the printEvenAscending function down but if not i'm open to help (My go...
[1 reply] : srand() goes in main(). But, since this is C++, you might as well do i... (by Duthomhas)
Array of Struct
 
I have to write a program where it takes in data of name, id, rate, and hours. I have to use an array of struct or this. I am unclear on how I should use ifstre...
[2 replies] Last: #include <iostream> #include <string> #include <fstream> struct P {... (by fiji885)
C programming- array
 
I get this two warnings when im trying to run my program. I canĀ“t seem to solve it. However when im removing the infront of the char-types I get no error but...
[11 replies] Last: Here is your program, updated to help you. #include <stdbool.h> #in... (by Duthomhas)
Math
 
Hello . I'm in school right now but i'm trying to learn c++ , and i really want to make something for myself and maybe my friends . What i want it to do is basi...
[5 replies] Last: Well i fixed it . Thank you so much <3 (by ialexsandu)
Melon
 
#include <string> #include <iostream> #include <cmath> #include <fstream> #include <vector> /*int buscar_menores(int pivote const std::vector<std::string> ...
[3 replies] Last: @coder777, After I wrote that I noticed that one of the posts was rep... (by Handy Andy)
c++ game problom
 
my code is not working im using visual studio 2017,i tryed romoveing #include "stdafx.h" it solves the probloms but it asks to put it back in the code: #i...
[2 replies] Last: could you elaborate on the problem, and explain what happens when you ... (by Arctic)
generating card box
 
Hello im getting stuck to generate my card design. the output of my card is okey but when it comes to card no 9, theres is gap huge gap at number 9. i am supp...
[5 replies] Last: @keena Could you display lines 41 to 57 as shown in the original post... (by whitenite1)
wrong answer with calculator
 
Hi guys I am making a simple token calculator and I am getting unexpected results for some reason when I type 2 + 2 q the answer will be 2 yet I add the rval...
[1 reply] : you type 2+2q it does some things and ends up in the + part of the swi... (by jonnin)
Using a class as a member for another class: incomplete type error
 
Hello, I'm fairly new to C++ and am having an issue with accessing a member variable that is of another class type. Here is an example of code: #includ...
[4 replies] Last: Ah, I see that now....worse in my actual code as I have four header fi... (by gppalm24)
Check if value exists in array?
 
How can I check if a value exists inside of an array. Something like this: if(99 in ourArray) { //Do stuff }
[1 reply] : You could use std::find. if (std::find(std::begin(ourArray), std::en... (by Peter87)
Fahrenheit to Celsius and vice versa conversion help
 
Can you please help? This is what i have. #include <iostream> #include <string> #include "cstdlib" using namespace std; double far (double a, double c); do...
[5 replies] Last: The far() and cel() routines are the wrong way round, and have too man... (by lastchance)
how to compute a value of intersection of two arrays?
 
I was able to write a function that prints out the intersection of two arrays. However, I am trying to obtain the value of the members of the intersection. if o...
[8 replies] Last: @MadMaul13, intersection_arr is still a zero-size array. It is still... (by lastchance)
difference seekp and seekg
 
Can anyone tell me in a simple way what is the difference between seekg and seekp? The tutorials are pretty much complex for me. Thanks!
[1 reply] : It is currently a flaw in many library implementations (and, IMHO, the... (by Duthomhas)
by isan
send message to all clients who are connected to server
 
In this code I want to send a message to all clients who are connected to the one server But it can echo to the client who sends something Not all of them Wh...
[3 replies] Last: @Repeater Thanks for your response and I added this to my code, but I ... (by isan)
Array help, outputs the wrong thing
 
So, I thought the code looked good, but it doesn't output what it should. The code is supposed to be like: Mailbox #1, #4, #9, #16 is closed etc. but ...
[1 reply] : You want something like this for peter... its not exactly right but th... (by jonnin)
Watermelon
 
A #include <fstream> #include <string> #include <vector> #include <iostream> void mirardatos (const std::vector<int>& datos, int m, int n, std::vector<...
[no replies]
Pineapple
 
#include <string> #include <iostream> #include <cmath> #include <fstream> #include <vector> /*int buscar_menores(int pivote const std::vector<std::string...
[1 reply] : No tienes una pregunta. Edit: I see you're just a troll or a really s... (by Ganado)
homework problem someone plz solve..fun with geometry
 
A rectangle is represented with two coordinates.The first coordinate (a,b) represents the top-left point and the second one (c,d) represents the bottom-right po...
[4 replies] Last: Figuring the intersection of two rectangles can be a pain. Here's an e... (by dhayden)
c++ output explanation
 
#include<iostream> using namespace std; int main() { int n,k; int j = 8; for (int i = 0; i < 3; ++i) { switch (i) { case 0 : k = 2; n = (( (...
[4 replies] Last: thank bro for the help (by sahil9620)
infile -> outfile does nothing
 
I'm trying to ignore some lines in temp.txt and copy the rest to temp2.txt. when the line has two doubles they should be output, otherwise ignored. ...
[3 replies] Last: @cire Thank you, this works as I need it to. What is the difference b... (by smoothstone)
January 2018 Pages: 1... 56789... 22
  Archived months: [dec2017] [feb2018]

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