General C++ Programming - June 2015 (Page 3)

Code works only half way
 
I am working on a console application that is to take inputs from the user and output the largest so far only the first two inputs seem to work, the last three ...
[5 replies] Last: It's easier to store the maximum number in a separate variable and the... (by dhayden)
From char to long double
 
I have an array of characters which holds this data: '2'',''2''.''5''6'',''0''.''5'','';'. Regardless of how improper this is, for the sake of simplicity, I'll ...
[2 replies] Last: Thanks! (by RealGiganitris)
by Ozzy69
Help me with the library chrono
 
Hi, i am with problems in library chrono, because when put within of the fuction switch, appear a messenger of error, look of the picture. Sorry for my engilsh!...
[1 reply] : A jump to a labelled statement ( case xxx and default are labelled st... (by JLBorges)
by smsmsm
pthread write in file
 
Well I have program which have 5 thread one of them is write I know that all the other thread work correctly but in write thread it doesn't write to file co...
[no replies]
get Ip address from sockaddr
 
//Server int sock; pthread_t thread; struct addrinfo hints, *res; int reuseaddr = 1; /* True */ /* Get the address info */ ...
[3 replies] Last: Uh, OK. I can't see how anyone can hate stackoverflow, but regardless... (by naraku9333)
by Won
Split string
 
Hi! I would like to know, how could I split a string in all possible way? For example: 123456789 It's easy to write the code, to split into two. 1 234...
[15 replies] Last: Thank you very much MiiNiPaa !! It works perfectly! In some version ... (by Won)
read from client and save to a folder in server
 
Hi. I have written a server. Now in the process of writing client. Say i send a file to server called myFile.pdf and wish to save it to a directory in...
[1 reply] : This question is leaning toward being platform dependent OP. Basically... (by Computergeek01)
Weird Including Issue With Injected DLLs
 
Right, I don't really know how to phrase this question, as my issue is quite strange. Basically, I am using a DLL which is injected into another program. The...
[3 replies] Last: If you are referring to that part about "what is actually happening" t... (by Computergeek01)
Cant get input to be used in calculation
 
i am new c++ learner and i am writing this program thats supposed to take input from the use and calculate the average but i cant seem to get the input to be us...
[3 replies] Last: Thanks a lot SamuelAdams, now it works, and i have been tearing my hai... (by edmamol)
by asd11
Problems with the compiler I guess...
 
Hi everyone, I've just done a simple game in C++ (sth similar to impossible rush if you know it) using classes. At first building and running it, everything was...
[5 replies] Last: My last post is the final version! ;-) (by asd11)
move sematics
 
If we have say a move constructor like this: struct A { int n; A(){ n=0; } A(A&& other) { n = other.n; } }; And I do something simple as: A...
[3 replies] Last: Passing by reference is bassing by reference: no copy is made. (by MiiNiPaa)
Printing a table!
 
Hi guys! Here is the deal: I have some data stored in a float data and each row represents a "math, geography, etc" and each column represents the grades rela...
[2 replies] Last: see http://www.cplusplus.com/reference/iomanip/ use iomanip header fi... (by sujitnag)
by smsmsm
write in specific line in c++
 
Hi I have a file with 1000 of '\n' ( I mean it has lots of line) I'm looking for a way to writ in specific line of it.
[1 reply] : With the way file systems work, you have to rewrite the whole file. If... (by LB)
Multidimensional Vectors
 
I was wondering how one would go about initializing a 2D vector. With a regular vector, one would typically just initialize the vector in the following mann...
[3 replies] Last: > I keeping getting an error with > vector<vector<int>> v = {{1,2,3},... (by JLBorges)
by cGuru
Sorting A Vector Of Structs By Contained Data
 
I am sorry if there is similar questions already present on the website, but am currently failing to understand certain parts of the algorithm. I have a Struct...
[3 replies] Last: Well, I have posted a link to example. You need a "predicate" example ... (by MiiNiPaa)
Console Interaction
 
I'm working on C++ on CodeBlocks with consoles of application. I'd like to set the value of a variable from one program in another program (having two programs...
[10 replies] Last: A very simple way would be to use a temp file to store data they could... (by SamuelAdams)
by ataik
finding differences between two htm files
 
I have two htm files including the components and 9 parameters of components and there are lots of components in the lists. When i try to change to text file it...
[1 reply] : A html file is just a text file with a fancy name so that a web browse... (by SamuelAdams)
Strange problem when compiling a program
 
Hi, every time i try to compile the following code the compiler strangely opens another window with another code in it (that i didn't write ,i know i'm missing...
[2 replies] Last: i'm using Dev-c++ 5.11 (by mescalito)
Check amount of digits
 
Whats the faster way (fewest lines of code)to check amount of digits a user enters. for example i have struct money { int value1, value2; }; ...
[3 replies] Last: A number that is larger than 99 does have more than two digits, doesn'... (by keskiverto)
how to resize a vector
 
void bag::add(BAG_ELEMENT_TYPE newElement) { if (my_size == my_capacity) { my_element.resize(2 * my_capacity); } my_element = newElement; my_si...
[1 reply] : my_element.push_back( newElement ); (by ne555)
June 2015 Pages: 12345... 16
  Archived months: [may2015] [jul2015]

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