Beginners - August 2018 (Page 13)

Array
 
Some automated computer-based machines can output a text file containing rows and columns of numeric data values. These data values may, for example, give a his...
[7 replies] Last: Hello soccer53, I had a thought that if using the "fin.ignore(...)" i... (by Handy Andy)
by AL88
why is this not returning 4
 
I'm really confused as to why this is not returning 4. Help please :-) #include<iostream> int difference(int a, int b); int main() { int currentYear = 20...
[1 reply] : You don't do anything with the return value. You either have to stor... (by Peter87)
Modular HCF
 
can anyone expain the method to find gcd of two extremely large no.s. Here is the link to the question.. https://www.codechef.com/AUG18B/problems/GCDMOD
[5 replies] Last: Which property (by closed account 3UohqMoL)
by nomat
Overloading functions
 
Write your question here. Guys this code is supposed to be simple and call the overloaded function accordingly, yet when I execute this code it does not give m...
[2 replies] Last: when zone is below 0 or above 7 the program is not supposed to calcul... (by nomat)
putting particles on fcc lattice
 
Greetings, for a Monte Carlo simulation of N hard spheres, I want to set up the initial configuration as a fcc lattice. I am thinking about how to do it most e...
[1 reply] : I think I have my solution. Just in case someone is curious^^ #inclu... (by PhysicsIsFun)
Getting wrong numbers
 
I am having difficulty with this program. I am supposed to using OOP and arrays. My problem is that it comes back with over 200,000 F's when the input file doe...
[3 replies] Last: Do not remove the content of your post after your question has been an... (by Ganado)
by stav
Accept any stl container as argument but require type
 
Hi, I recently learned that you can accept any container by using a template like so: template <typename T> void SomeFunc(T container) { container.insert(co...
[1 reply] : This code won't compile until you take out the attempt to use SomeFun... (by Repeater)
Help me (Anagram Substring)
 
Rotate a given String in specified direction by specified magnitude. After each rotation make a note of first character of the rotated String, After all rota...
[2 replies] Last: How can we know what's wrong with your code, if you don't show it to u... (by MikeyBoy)
by Kai456
cout doesn't output the same as printf, why?
 
First I define a single character 'b' as variable b. Then I try to print the address using both cout and printf, but cout spits out a bunch of garbage while pri...
[12 replies] Last: operator<<(ostream&, char*) would have been highly inconsistent and i... (by MikeyBoy)
Please to check the following solution.
 
/*HEllo everybody. i would like to see your recommendations and your quotes. how can i optimize this code? what is wrong into the code? what can it be i...
[5 replies] Last: You can call me whatever you feel comfortable with. (by JLBorges)
Soliciting advises
 
Hi The summer semester is coming to an end. The beginner course in programming is the only course for the Associates Degree and I feel that it's not enough. ...
[6 replies] Last: I've been a software engineer for 30 years and im sure most will agree... (by Jaybob66)
Calculator
 
So I`m writing a calculator program and I need some help with an easy fix. The only problem that I see is that twonum needs to be the first thing that is...
[3 replies] Last: remove the returns and add else clauses.... if(stk.empty()) ... (by Jaybob66)
Pascal's triangle and 2D vector
 
I'm trying to solve the following problem given here: https://leetcode.com/problems/pascals-triangle/description/ However, when I try and fill the 2D vector ca...
[2 replies] Last: one of those weird math tricks: you can seed it with pow(11,0) through... (by jonnin)
by ysf007
why I'm not getting the right values
 
Hey, I've a map that I set on it these values map<string, size_t>::iterator it; for ( it = indexBin.begin(); it != indexBin.end(); it++ ) { ...
[3 replies] Last: I forgot to add the extention, error of beginners indexBin.find(Name... (by ysf007)
by thmm
Code too slow
 
How can I speed up my code ? /* Meliodas and Ban are fighting over chocolates. Meliodas has X chocolates, while Ban has Y. Whoever has lesser number of choc...
[10 replies] Last: try this #include <bits/stdc++.h> using namespace std; int main() ... (by closed account 3UohqMoL)
C to calculate pi and find error between calculated pi and actual pi
 
Hi, my first time writing in C to calculate pi and get the error from the actual pi, I have to write it with MPI, whenever I change the input from scanf to fget...
[1 reply] : @silver11235, My implementation of MPI (mpich) didn't like scanf eithe... (by lastchance)
Extracting decimal values from file
 
I would like to read from a file and produce decimal values that are between 0 and 255 to produce an eight bit binary number. I have discovered a way to do this...
[2 replies] Last: I acted on your suggestion and changed argc < 2 to argc != 2. It seems... (by Hadal10)
Where to put many game objects
 
I apologise if this seems like more than one question but... In my rpg text adventure project, I'm having trouble knowing where to put all the game objects. ...
[6 replies] Last: Put this program down and use google for a few min or look in these fo... (by jonnin)
Unresolved external symbol referenced in function error when compiling .dll
 
I am trying to create a `.dll`and I get the following errors. I can confirm that the `_ki/_kj` are correctly defined in the header file. The `q.lib` file is x86...
[1 reply] : q.lib : warning LNK4272: library machine type 'x64' That seems to ... (by Repeater)
by Kai456
Help with deleting characters from an array
 
I wrote a program that should generate an 10x1 array of 'A,' and then process that array by deleting an element, one at a time. Couple of questions: when I set ...
[2 replies] Last: Thanks tpb! Very helpful response. (by Kai456)
August 2018 Pages: 1... 1112131415
  Archived months: [jul2018] [sep2018]

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