Beginners - August 2018 (Page 7)

by AL88
Please explain and help me fix these compiler errors and warnings
Please explain the compiler errors and warnings: alistair@alistair-Satellite-Pro-L300D:~/C++Practice/AnIntroductionToProgramming$ g++ q2ch11.cpp -std=c++11 -...
Aug 17, 2018 at 7:20pm
[2 replies] Last: -fpermissive Do not do this. Instead, write correct C++. (by Repeater)
by AL88
why cant I make square take one perimeter whilst rectangle takes two?
My book is asking me to make the rectangle class constructor just take length whilst making rectangle take width and lenght , how do i get it to compile? ...
Aug 17, 2018 at 6:45pm
[3 replies] Last: The "virtual" mechanism doesn't come into effect unless you use pointe... (by tpb)
How to organize classes for correct access
I'm fairly new to OOP, and right now i'm stuck on the correct way to allow multiple classes to have the correct access rights to each other. So, i have three c...
Aug 17, 2018 at 2:13pm
[1 reply] : You forgot to mention who owns what. From your second paragraph I assu... (by helios)
choose random vector entry (1,2,3)
Hi guys, is there an easy way to choose an integer between 0 and N? To be more precise, I want to randomly(!) choose an element from a vector, so I thought ...
Aug 17, 2018 at 1:50pm
[54 replies] Last: Thank you guys, you have been a great help :)! (by PhysicsIsFun)
Reading certain values of a vector and write them into another vector
Greetings, I couldn't succeed on doing that. Here's basic parts of my code that i tried to read certain rows within a vector and tried to write them into anoth...
Aug 17, 2018 at 6:45am
[2 replies] Last: Hello, Does QLT.size() == 0 at line 1? Yes. I tried "Push back" ... (by oayrancioglu)
A vector of unique_ptrs pointing to unique_ptrs
Sorry for such a basic question, I'm coming back to C++ after like 15 years and having a really hard time finding sources that explain how vectors interact with...
Aug 16, 2018 at 11:56pm
[2 replies] Last: About using std::vector<Room*>, I was under the impression that I woul... (by Stuffman)
network connection
hello guys, please i want to develop an application that connect devices together so to receive and send files, and message. example: a laptop who has my appli...
Aug 16, 2018 at 8:00pm
[1 reply] : Take a look at boost asio: https://www.boost.org/doc/libs/1_68_0/doc/... (by coder777)
Hard spheres - check for overlap (1,2)
Greetings, in a Monte Carlo simulation of N hard spheres, radius R>0, I randomly choose a sphere and propose a new position for this particle in the direct vic...
Aug 16, 2018 at 2:31pm
[30 replies] Last: ah ok, yeah, it might help that I just have to update one row of the a... (by PhysicsIsFun)
by l0gic
Heap Array
Hello, I am new in C++ enviroment. I was a C programmer for 2 years. After knowing so much about it, I decieded to move to somthing bigger like Java or C++. I d...
Aug 16, 2018 at 8:14am
[11 replies] Last: When you paste code and the editor needs to insert line breaks in the... (by Peter87)
%*s means in sscanf
Write your question here. #include <stdio.h> int main () { char sentence ="Rudolph is 12 years old"; char str ; int i; sscanf (sentence,"%s %*s...
Aug 15, 2018 at 5:11pm
[1 reply] : https://en.cppreference.com/w/cpp/io/c/fscanf %*s causes a string t... (by mbozzi)
No clue how to deal with this error
I'm trying to make a program which gives me all the words that have a certain number of letters, it gives me the error: "invalid conversion from 'char' to 'cons...
Aug 15, 2018 at 4:41pm
[5 replies] Last: also, @holyheck, is there a reason you're trying to work with C-style ... (by icy1)
by RCPP
Defining A Range
Hello everyone. I am stuck at a point where my program won't go for a loop. I'm trying to define a range of numbers and not with vectors or arrays but with a fo...
Aug 15, 2018 at 2:23pm
[19 replies] Last: [quote=rcpp]Last but not the least, what should I do if I want numbers... (by lastchance)
by Issa
Error
Hi I have written according to the instruction but I still gett an error. According to data, it says that it can not find the file or directory. Dont kno...
Aug 15, 2018 at 12:57pm
[4 replies] Last: OK, Thank you icy1 and FurryGuy for the help/information. I considerin... (by Issa)
Pointer not returning the way I was expecting to
I have decided to overload the builtin 'string' class and create my own custom String class in order to improve my knowledge regarding operators overloading in ...
Aug 15, 2018 at 11:05am
[12 replies] Last: Thank you very much for all your replies! I now understand how things ... (by teodor0xcb)
how to share a int with a function
i want to share the selection in main with the down function and get de comfirmation of my selection including the 2 cout (in main and selection) #inclu...
Aug 15, 2018 at 2:28am
[1 reply] : #include <iostream> int choice( int min_value, int max_value ) { ... (by JLBorges)
Filling a vector of non-integer type using a for loop
I've got a function that initializes objects of Enemy class (just once), expanding the vector of <Enemy> class type. A for loop doesn't work, however, as it tri...
Aug 14, 2018 at 8:42pm
[6 replies] Last: Yeah, I did now. As a matter of fact, I had done that in other classes... (by lambavvv)
Help! Matching numbers
The user has to guess 6 numbers before they are generated. Your program will then tell the user what are the matched numbers. If the user chooses any number les...
Aug 14, 2018 at 4:33pm
[11 replies] Last: you are doing great. Now that you have it working consider these idea... (by jonnin)
passing a value from one code to another
It's my first time writing a real program (UI and stuff) I am using GTK+ with C. My program is written in C++, and I also have some simple ones in python. ...
Aug 14, 2018 at 7:44am
[2 replies] Last: You're asking about "inter process communication". https://en.wikiped... (by Repeater)
why the player is not switching between "X" and "O"?
I cannot understand why the player is not switching between "X" and "O"? #include<stdio.h> #include<iostream> using namespace std; char matrix = ...
Aug 14, 2018 at 5:05am
[4 replies] Last: @philip1999, Please read @mbozzi's post. You need that ampersand & in ... (by lastchance)
Visual Studio - Windows application
Hello, I am looking for advise. I want to use VS to program a window (s), that have a library of electrical components like, bus, Line, Generator, transfo...
Aug 14, 2018 at 4:48am
[3 replies] Last: Hi Andy, Thank you for the advise. The core program that I created ba... (by tghatem)
August 2018 Pages: 1... 56789... 15
  Archived months: [jul2018] [sep2018]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.