Beginners - May 2016 (Page 5)

How do I initialize a 2D Vector?
 
Say I have a 2D vector that is 3x3 If I wanted the following values stored in the 2d vector 0 3 5 5 2 3 3 2 1 How would I go about implementing code ...
[no replies]
Code Blocks Info.
 
Hello. Can someone give me examples of 'some code' that I can practice with 'in' the code blocks ide? I'd like to get a feel for things further of the program. ...
[13 replies] Last: I can copy/paste quite easily without including the line numbers. Wit... (by closed account E0p9LyTq)
by noodel
writing into the file
 
Hey, whats wrong with this? Why when I use ofstream for writing the results in file the program does not work? I mean the line "write the number" just keeps on ...
[2 replies] Last: And is line 20 meant to be cin >> x also? Right now x doesn't cha... (by dhayden)
How to master functor?(done)
 
How to master functor and what's wrong in the peice of the code below? Thank's in advance. #include <iostream> #include <functional> using namespace ...
[2 replies] Last: Thank you very much. It does I make a mistake and I do understand. (by codewaggon)
Program for finding primes/ common denominators
 
Hey i need help streamlining a program and generally improving my coding vocabulary. i made a program that calculates whether or not a number is prime, and if s...
[no replies]
Calculator Problem - Stroustrup C++ Book
 
I'm trying to better understand this code from the book "Programming: Principles and Practice Using C++ (2nd Edition)" by Bjarne Stroustrup. I did try searc...
[no replies]
by feeks
Encrypt Decrypt
 
Im trying to do this problem but its only reading the encryption portion and not decrpyting after. #include "stdafx.h" #include <iostream> #pragma war...
[2 replies] Last: @Tyler T is right.... you have not written the if-else statement corre... (by shadder)
Used Car Dealership, Help
 
I'm working on an assignment that uses classes to help my "uncle" keep track of the inventory in his dealership. He starts with $10,000 and no cars. In the main...
[14 replies] Last: Hi, I was going to say this: Look carefully at the code provided by ... (by TheIdeasMan)
More Used Car Dealership Help
 
I posted about this assignment last night, and am now almost completed. I just have one more thing that i need to figure out. On option 6 of my main menu, I'm s...
[3 replies] Last: Hi, One can delete their own posts, then I can delete mine :+) This w... (by TheIdeasMan)
Class - "no 'void Birthday::printDate()' member function declared in class 'Birthday'"
 
I'm getting the error "no 'void Birthday::printDate()' member function declared in class 'Birthday'" When trying to execute my code, I'm learning from videos/bo...
[2 replies] Last: Hi, C++ is case sensitive. The Declaration and definition must match.... (by TheIdeasMan)
by calin
Help with reducing the execution time
 
How can I reduce the execution time of this program to 0.1 miliseconds. The program is suppose to write the k number of a string that started from the number p....
[1 reply] : It would help to get the input when the user starts the program instea... (by SamuelAdams)
read file error trouble
 
#include <iostream> #include <string> #include <fstream> using namespace std; struct Movie // movie information { string name; int year; double price; }...
[5 replies] Last: @jlB I believe it might be the compiler or the IDE either way i will r... (by rezy3312)
% modulo for random, remainder (1,2)
 
i know that % modulo can be used for remainder also know that % can be used for randomizig numbers how exactly does % do these? there must be a couple fu...
[20 replies] Last: with % in newer languages rand() must be built in useful (by programmerperson1)
Uppercase and Lowercase HELP
 
Hello everyone, I am stuck with this problem. The problem is ask user to enter a string, then convert the odd words all to uppercase, the even words are lowe...
[8 replies] Last: Great. thank you guys. (by lizhley123)
'File Does Not Exist' Issue
 
Selecting any option (1-5) results in 'This file does not exist'. I've fiddled around, to no avail. I'm guessing it's something to do with the folder structure ...
[9 replies] Last: Thanks, everything is working as it should now. (by idkwidlol)
by feeks
Create a program that inputs two integers and outputs the larger
 
I wrote this code and it only outputs the larger integer if the larger integer is the first number. Otherwise it will say press any key to continue. #inclu...
[6 replies] Last: 1. If num1 is larger, does the program output num1? (yes/no) 2. If num... (by PBachmann)
store data,read specific lines of data from a file and again store them separately into variables to be used further in program
 
I am working on a management system in which the user inputs some integers for different prices of items and gets the output.I need to store them in a file and ...
[6 replies] Last: Thank you for your help Bdanielz! (by noorulhuda)
Sleep () function , issue in c++
 
i am trying to make a very simple keylogger using the GetAsyncKeystate and i am adding the sleep function to reduce cpu usage ,however when i add Sleep...
[1 reply] : If you remove the Sleep statement does the code execute properly? Coul... (by McNo)
copy array
 
how to declare another array(bigger), copy 1st array into it, then copy 2nd array after that, continue from the last item of array 1, not to replace them. Then...
[1 reply] : #include <iostream> #include <algorithm> int main() { const int ... (by JLBorges)
How to get string that contains whitespace from .txt file and insert the data into linked list?
 
I'm using class and object and my data in "realestate.txt".I want to display my list but the output cannot display after the data that contain whitespace. I use...
[1 reply] : Not enough information. You haven't shown us what u and node look li... (by AbstractionAnon)
May 2016 Pages: 1... 34567... 36
  Archived months: [apr2016] [jun2016]

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