Beginners - June 2014 (Page 28)

by h4ever
Include of file with function
 
I'm using Visual Studio C++ 2010 on Win XP. I have created working script to capture screen and save it to png file. I decided to move the function the .h fi...
[2 replies] Last: Oh, thank you. That helped. I needed include windows.h (by h4ever)
Stuck with a couple exercises
 
#1 Get the "name and age" example to run. Then, modify it to write out the age in months: read the input in years and multiply (using the * operator) by 12. Rea...
[1 reply] : The book was regarding old syntax/regulations. It has been dealt with ... (by closed account j3Rz8vqX)
Accessing multidimensional vector in a class.
 
I have a class CharMap and in its constructor I have this: vector< vector<char> > CharGrid(xres, vector<char>(yres)) . I don't get any errors from initializing...
[1 reply] : Your CharGrid is not populated. You are accessing bounds that are not ... (by closed account j3Rz8vqX)
New to programming, Issue with Visual Studio 2013
 
Hello all, I am new to coding entirely. I am trying to use accelerated c++ to get my basic learning out of the way, but I cannot get the source file for hello w...
[3 replies] Last: My apologies for the late reply, I was very preoccupied at work. Thank... (by adrns012)
updating the contents of a file
 
So what I need to do for this program is to read from a transaction file all the data and then update the master file accordingly. Everything reads in okay but ...
[4 replies] Last: If you want to replace a string in the file, the new string would need... (by Chervil)
Sort Algorithms using Pointer Arrays
 
Hello! I'm new in town and I working on sorting Pointer Arrays. I am familiar with the bubblesort, but I'd like to learn a more efficient method. I am includi...
[3 replies] Last: http://www.cplusplus.com/faq/sequences/sequencing/sort-algorithms/ for... (by Duthomhas)
by T3C
For Loops
 
I began learning C++ today, and it's my first programming language so please bear with me. I want to execute a for loop that would allow me to receive the input...
[3 replies] Last: Thanks guys. (by T3C)
Return ref to a constant object
 
Write your question here. Using eclipse, if the object is a constant, it allows to return a constant object too. The compiler complains "invalid initialization...
[3 replies] Last: Well, the problem there is that you are returning a non-const referenc... (by firedraco)
Function Overloading logic / understanding
 
Hi All, I am literally just beginning learning C++, following a beginners 21 day tutorial... I'm learning about "function overloading" and would just like...
[3 replies] Last: Yes. (by Peter87)
enemy keeps leaving screen
 
My game right now has a random movement setup for the enemy 'i' but it keeps leaving the screen. any way to keep it in the play area? here is my code right now ...
[3 replies] Last: Your algorithm isn't incorrect (intended double negative). I am sayin... (by closed account j3Rz8vqX)
2D array
 
Say for example, I have a 4x4 matrix of numbers in a file. 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 How do I put them in a 2d array and then display them? ...
[5 replies] Last: In the above, we read data from one array to populate another. For a ... (by closed account j3Rz8vqX)
Temporary Variables
 
Once the function is executed, wouldn't the memory used for pc be freed? In that case, there would no longer be any array, just a pointer to char called pc. D...
[2 replies] Last: You should see the difference between stack variable char* pc and th... (by JockX)
Function problem
 
Write your question here. #include <stdio.h> #include <stdlib.h> typedef struct node { char author ; char title ; int year; struc...
[2 replies] Last: sorry some stupid connection mistake ...exactly that! i wrote that as... (by polka21)
by stlund
Function overloading with Float and Integers.
 
So I'm trying to make a program that calculates celsius to fahrenheit with function overload. I have 1 function that calculates and 2 others that takes the d...
[3 replies] Last: You can write an overloaded version of CTF as well, float CTF(float ... (by eyenrique)
function prototype vs non prototype
 
hello i just want to ask if there is a difference between prototype function and non prototype. example: int add(int x,int y) { return x+y; } int ma...
[5 replies] Last: I see thanks all my question has been answered thank you all (by xenovia12)
Give the error c++ help me please!!
 
#include <iostream> #include <string> #include <fstream> #include <cstdlib> #include <cstring> using namespace std; // Inheritance to create two new c...
[5 replies] Last: You have only created the Car class. If you don't know the difference ... (by Peter87)
Login system help
 
Hi! I am new to c++ and i want to do a login system for a program i am working on. I want it to use a file. The code below is all I can think of right now. I ...
[2 replies] Last: Thanks for the help. Yes i mean user2 and user sorry for that. Uhhm i ... (by Space Spaghetti)
by Typ
Count repetitive Input (Array)
 
Hello again, I wrote a modular program, which -gets 10 integers and saves it in an array, -sorts them by value ( + displays the biggest and smallest one), ...
[4 replies] Last: If the array is sorted, you can rely on this to count the number of re... (by Smac89)
100 - 1 = 990, 990 - 1 = 980 while 120 - 1 = 119 and 119 - 1 = 118
 
This Code: for (int cntr = 100; cntr >= 0; cntr = cntr - 1) { std::cout << "\r\r\r" << cntr << std::flush; std::this_thread::sleep_for(std::chrono::seco...
[8 replies] Last: Or just... use a newline... (by NoXzema)
extern versus namespace (1,2)
 
I've almost never used the keyword extern, in fact I've never needed it. If you want to use functions from another file, you can put those functions in a namesp...
[20 replies] Last: Although, I would agree that most of zwilu's arguments are nonsensica... (by closed account jvqpDjzh)
June 2014 Pages: 1... 2627282930... 48
  Archived months: [may2014] [jul2014]

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