General C++ Programming - September 2016 (Page 14)

store 2 values in std::vector
 
Hi, I need to store x & y coordinates of point(of type double) in arraylist, then I have to sort this with respect to values of x. I hope so I am clear. s...
[2 replies] Last: I have one more problem, std::sort(arr.begin(), arr.end()); st... (by sam1989)
number generator questions
 
#include <iostream> #include <cstdio> #include <cstdlib> #include <ctime> #include <algorithm> using namespace std; void gen(int num ) { for (int x...
[7 replies] Last: void gen(int num ) { for (int x=0; x<10;x=x+1) { num = x+... (by glennford49)
C++ Map Binary Tree
 
Hello! I have a hard time understanding the question from Alex Allains book "Jumping into C++", 6. Implement a simple map, in the form of a binary tree, that...
[17 replies] Last: @keskiverto Hmm alright, I get the first part, but do you mind showing... (by Willo123)
Reading specific lines
 
Hi. I have a program that I'm trying to read through a file, but the tricky part is that I'm only allowed to read some lines and store those line in c-string. T...
[5 replies] Last: Any help anyone?? (by Fabioc99)
Array of structure Print
 
Guys i am trying to print an array of structure but all in vain. The error i am receiving is that no suitable conversion from student to student*. Can anybody h...
[2 replies] Last: thank you very much #gentleguy and #shadder. it worked. (y) sorry guys... (by Salman0391992)
by AcarX
Parsing logical expressions
 
Hello. I'm trying to write an experimental database and stuck with parsing logical expressions. For example: col_1 = 10 and (col_2 = 'test' or col_2 = 'test2...
[5 replies] Last: Hi. Just an opinion. Trying to build a parser is not an easy taks. Why... (by ocreus)
Arraylist in c++
 
hi, I am looking equivalent of below in c++ ArrayList neww = new ArrayList(); neww.Add(2.02); neww.Add(1.02); neww.Ad...
[3 replies] Last: Thanks to Everyone! (by sam1989)
How to implement a general tree?
 
Hey guys, I know how to implement a BST, but I have no idea how to implement a general tree. Could anyone please help me? Thanks.
[1 reply] : What is a "general tree"? We can help you (find resources to) imple... (by mbozzi)
CODE GIVES WRONG ANSWER
 
My solution won't work. Had to use typecasting because x was previously used as int. #include <stdio.h> int main(void) { (int) x; double y; do...
[6 replies] Last: You said, It's a 3 part assignment. So when I do int x it would say r... (by closed account GwU9E3v7)
(HW) Using array for a maze to get an object through to winning area
 
So I am trying to complete an assignment where we must move an object through a maze of 0's and 1's where the 0 is open to movement, 1's are blocked blocks, and...
[2 replies] Last: So I do not know what recursion is, and what would the code actually l... (by jlmccart01)
Help
 
How do i create a Pig Latin Converter program that will read in a file called "pigLatinFile.in" of English sentences, convert them into Pig Latin, and will outp...
[1 reply] : It appears you posted the same problem here: http://www.cplusplus.com/... (by AbstractionAnon)
How make IAT Hook in a application using a injected dll
 
Hi, i'm wanting make IAT Hook in a executable application using a injected dll and already read in several websites from Google about this. So, i have a code ...
[1 reply] : Why don't you just use a hooking library? (by helios)
identify intersection & correct
 
Hi, I have to write a program, which will identify shape(this is combination of rectangle & traingle) intersecting with same shape. If they are intersecting, ...
[3 replies] Last: Do you mean something like: C2.x = C1.x + C1.radius + C2.radius; C3.x... (by keskiverto)
Username and password system
 
I am working on a username/password system, and I don't know how to do file saving. If anyone could help me out on how to modify this code to save the char us...
[1 reply] : Hi, please use code tags http://www.cplusplus.com/articles/jEywvCM9/ ... (by shadder)
Why is there no Disjoint Set class in the STL
 
One of the data structures we learned about in my algorithms class is the disjoint set. We also learned about: queues, priority queues, heaps, sets, stacks, ...
[3 replies] Last: No, no. https://en.wikipedia.org/wiki/Disjoint-set_data_structure (by helios)
Loop through character array until null character
 
I want this program to go through a character array and display each element until the null character is reached. This is basically the code from my textbook, b...
[1 reply] : Oh I see! Thanks so much! (by cpp1024)
Difference between atoi and stoi
 
What is the difference between atoi and stoi?
[2 replies] Last: You can read the description of each: http://www.cplusplus.com/referen... (by keskiverto)
Understanding why null and zero
 
This is this program I am reading it goes like if ( char* pointer == null ) something1 else something2 if ( char* pointer == 0 and size of array...
[2 replies] Last: possibly even more Definitely, in conditions the comparison of point... (by keskiverto)
Printing Prime Numbers
 
Hey everyone, Can anyone give me some tips on how to print prime numbers from 2 to 100,000? I know I should be using a for loop but I'm unsure of how to rea...
[8 replies] Last: // Generates a list of all +ve numbers < limit, prime = 0, non-prime... (by closed account 48T7M4Gy)
by bozmin
Calling a function from an outside file
 
I m trying to call a function from a *.cpp file that exist in an other *.cpp file, an using a *.h file, but it still does not work. this is my useContact.cpp ...
[3 replies] Last: main.cpp should have your main function, not useContact.cpp. Contact.... (by JayhawkZombie)
September 2016 Pages: 1... 1213141516... 19
  Archived months: [aug2016] [oct2016]

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