Beginners - June 2014 (Page 37)

by CDavis
finding lowest grade of a 2D array
 
I have it to where the it checks the column for the lowest but at the very end it just spits out a garbage number how can i stop that lowestQuiz1 = quiz...
[1 reply] : Why do you need a 2D array for a list of grades? Someone could help if... (by Ganado)
by Ganado
Question about pointers/address addition
 
If I have double a = {10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0}; double* ptr = a + 1; //Talking about this line, the a + 1. Why does the...
[2 replies] Last: Alright, thanks for the quick reply. (by Ganado)
Pointers
 
The following code compiles runs, and usually gives the expected result but it contains a serious flaw. What is this flaw? Why is the program still able to prod...
[14 replies] Last: You should be assigning the values that pointers are pointing to. i... (by Ganado)
Creating a function
 
Normalising a set of data points to the interval [0,1]. Each data point is normalised as follows: Po = (P - min)/(max - min) Po = the normalised value P = t...
[1 reply] : I think it would need two passes through the array. First, simply find... (by Chervil)
by p al
Vector of vectors
 
Hi guys, I read somewhere that if you have sth like this: //cin>>CC; cin>>RR; already done vector<vector<int> > matrix; for(int i = 0; i<RR; i++) { vector...
[4 replies] Last: Thank you so much!!! (by p al)
Vectors
 
I need to make this code work with vectors? How can I do it ?
[5 replies] Last: That still has logical issues. Line 13. Do not trust that the file ha... (by keskiverto)
Star Pyramid Manipualtion (1,2)
 
If I have the following code that produces a center aligned pyramid, how can i remove the middle stars of the pyramid so that I have just the outline? See pict...
[27 replies] Last: Thanks again! (by JasonMcG)
Is it safe to delete[] of NULL?
 
int *p = NULL; delete p;
[5 replies] Last: That's the whole point of setting pointers to NULL after deletion is t... (by NoXzema)
by yepMe
Concatenating the elements of a vector in a single string
 
Hi Everybody, I have started learning c++ with the help of "thinking in c++" I am stuck at the 6th exercise of it, which asks to concatenate all the elements o...
[4 replies] Last: Thanks a lot to both of you, it's working now , previously the file wa... (by yepMe)
Write char array to binary file
 
I need to write a char array to new binary file. I tried to do something like this but without success. My code: char ch = "My name is" ...
[11 replies] Last: If you can fix the autoencoding problem, notepad is going to display t... (by Lowest0ne)
Using individual digits in a number
 
I've come across this problem several times and it gets me each time. Say now the user inputs a 9 digit bank card number, how would I perform individual operati...
[2 replies] Last: thanks, works like a charm (by Hercules)
by tdk93
Why is i=i++ undefined behaviour?
 
Since I'm a beginner this might be a naive question. But doesn't post increment operator means that the value is used first and then incremented. That is should...
[5 replies] Last: Thank you everyone I understand now So there are two separate assignme... (by tdk93)
Program Not Exiting
 
Write your question here. Why is the program not exiting? See case 0: in switch, line 46. /* * Chapter 21 Problem 1 * * Write a program that contains...
[2 replies] Last: Chervil, Thank you I added the if statement, and it works the way I ... (by phztfte1)
Order of calculation
 
Write your question here. I am wondering by which order the computer makes computations. For example in this expression: a*b*(x+y)*c; , what will be...
[1 reply] : what will be calculated first? unspecified. Compiler can calculate ei... (by MiiNiPaa)
Converting minutes to hours and minutes with my code
 
Hi people, I'm trying to do this small program for at least 2 hours and that's what I got so far. It should convert minutes to hours AND minutes: #include <...
[5 replies] Last: aaaah so that's what was wrong! thank you all for ur help! (by Dizzybee)
SIGSEGV when using libtcod (TCODConsole::root->...)
 
Hi! I'm a beginner with C++ and have started with this Roguelike tutorial: http://codeumbra.eu/series/complete-roguelike-tutorial-using-c-and-libtcod I'm using...
[1 reply] : OK... I managed to solve this as suggested here: http://doryen.eptalys... (by Nallebeorn)
by CDavis
arrays with dice game
 
So I've been having issues with array's and this last problem really has me. Basicly I need to provide a define constant for how many dice to use and with that ...
[no replies]
Trying to split an input into two separate strings for two different functions?
 
So I'm just getting into C++ programming, and I decided to go ahead and make a very short text adventure game. My goal is to make it so that when the user inpu...
[14 replies] Last: Here's how you can do it: void GetInput() { string input, word, a... (by a k n)
A Little Help PLEASE!!! (C++)
 
First of ALL my C++ Version: Borland C++ 3.0 So, the question is to make a code for the following: 1 + x/1! + x 3 /2! + x 5 /3! .............. I've made the f...
[4 replies] Last: The way I would recommend approaching this is to avoid the use of the ... (by Chervil)
Trailing Return Types
 
Im struggling to understand Trailing return types. Ive bee searching for simple example to understand it but cant find anything Basically..If i have a functi...
[4 replies] Last: I see.. Now i get it. Thank you very much MiiNiPaa. Helps me alot. (by skadush)
June 2014 Pages: 1... 3536373839... 48
  Archived months: [may2014] [jul2014]

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