General C++ Programming - May 2018 (Page 4)

return value 3221225477
 
can anyone help me fix my program #include <iostream> #include <string> #include <stdlib.h> using namespace std; int Random(int a) { return (rand() % a); } ...
[2 replies] Last: ok thx (by boomueki)
While Loop
 
Please guide tell me where i went wrong Write a program which will display the summation of numbers from 1 to 1000. #include <iostream> using namespace std; i...
[3 replies] Last: #include <iostream> int main() { const int from = 1 ; const... (by JLBorges)
by pepepe
Deleting from binary tree
 
Learning how to delete a node from a binary tree in three cases by myself -- leaf, one child, two child. When I run it, it gives error: 'deleteNode' was not dec...
[6 replies] Last: Thanks for the comment. I corrected the code so that it would properly... (by pepepe)
Problem with tracing code
 
Hi! I've problem understanding this code, I thought m is a variable? But in class A it seems to be a function? And the main class calls only object of type B, b...
[1 reply] : Hi, On line 12 m is an int. You may be confused by it being a funct... (by TheIdeasMan)
Efficient bounds checking for signed integers
 
The use of unsigned integers has many problems but if we use signed integers for our indices and want to check that the index is in bounds we need to add anothe...
[7 replies] Last: signed index is really useful now and then. consider... lets say you ... (by jonnin)
by CFLam
look for serialization class for VC++
 
Hello all, I need to read in/write out vector of struct from/to csv file. The struct has over 80 field (which contain int/float and string). I know how to ...
[1 reply] : Have you tried ditching the makefile and trying to compile it yourself... (by jonnin)
by keekee
static log4cxx::LoggerPtr logger
 
Is it a good practice put a log4cxx into private member and static it, like below ? class SomeClass { private: static log4cxx::LoggerPtr logg...
[2 replies] Last: @Ganado, my guess he means this: https://logging.apache.org/log4cxx/la... (by Thomas1965)
PATHS
 
You are given an N x M size grid where N is the number of rows and M is the number of columns. Your task is to calculate in how many ways you can go from the up...
[1 reply] : If you interpret your question so as to get the model answers (which i... (by lastchance)
by CFLam
Better(faster) algorithm to compare 2 vector of vector of integer ? (1,2)
 
Hello all, I have 1 set of raw data file(s), each has 8 millions~9 millions lines (yes, 8,000,000~9,000,000) in the following format, 1,2,3,4,5,16,...
[21 replies] Last: @icy1 Good idea, thanks, will find time to implement it, see if this h... (by CFLam)
Sentence filter
 
12.7: Sentence Filter Write a program that asks the user for two file names. The first file will be opened for input and the second file will be opened for out...
[no replies]
How to request Authorization token with c++ builder 6
 
I'm an Italian programmer and I’m using C ++ builder 6. I have to connect to a webservice. I have available a Wsdl that I downloaded and compiled, but ......
[no replies]
by lingfa
Why memcpy() does not copy any?
 
The following struct has 16 bytes. struct Data { double latitude; // 8 float speed ; // 4 unsigned short ...
[7 replies] Last: std::copy could throw, right? Perhaps I was thinking that. Yep, tha... (by Ganado)
Read text line by line without escape character
 
Hello, I am trying to read texts in a file line by line. Example: Line 1: Text1\nText2 here I am readingh this line using fgets/getline for 255 characte...
[2 replies] Last: I don't think it will produce an extra backslash \. I have testing in ... (by keekee)
What IDE do you use?
 
I'm just being curious. Edit: For c++. I use CodeBlocks.
[5 replies] Last: CLion is good, but it is not free. You can use trial version, anytime ... (by keekee)
Santa Monica College C++ class CS-52
 
This class comes with software. Does anyone know the name? Opinions would be nice.
[8 replies] Last: could just be old description too. When I learned c++ that was a comm... (by jonnin)
by wafty
C++
 
i want to help for "step counter" for merge sort and quick sort.... i want to print out how many steps it take to "random sorting ,reverse sorting and already ...
[1 reply] : Add an integer variable to each sort function, and increment it for ev... (by MikeyBoy)
updating grid in battleships
 
Hello all, I have another question today on my console battleship program. The game displays a sample 10x10 grid and allows the user to enter x,y coordinates t...
[2 replies] Last: Okay, thanks for the clarification. I will work on that today and see ... (by joemcmahon)
Please help with 2d-array
 
Hello, I am working on a array with 7 columns and 8 rows and I am attempting to calculate the average of each row individually and also each column individually...
[5 replies] Last: I thought the lines with the " for(int j=0;j<8;j++) and for (int i=0;... (by MikeyBoy)
by vn1310
Question about C++
 
Hi Everyone! I have a question about C++! I run the program, but it doesn't give the output! Thank you so much in advance for all your help! A teacher has f...
[1 reply] : You need a quotation character in front of Smith. vector<string> nam... (by Peter87)
battleship program logic issue
 
Hello, my program I am working on currently is a battleship program. The program runs and I have it display the grid with the answers for now because the probl...
[5 replies] Last: Yep, no problem. Happy coding! (by Ganado)
May 2018 Pages: 123456... 11
  Archived months: [apr2018] [jun2018]

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