General C++ Programming - December 2012 (Page 31)

About reading from file to string
 
Any possible problems with this code? int main() { std::fstream in("file.txt", std::ios::in); in.seekg(0, std::ios::end); std::size_t len = in.tell...
[1 reply] : There is a portability problem with using seekg/tellg on files open in... (by Cubbi)
by Xyexs
Timer and other problems... (1,2)
 
Hey, i'd like to know how to make timers (if possible). This is my current code(not done, im still learning) void wait(int seconds); void wait(int seconds...
[28 replies] Last: the problem is, im 13 years old and my native language is not english ... (by Xyexs)
how to use strings with loop
 
thank you
[2 replies] Last: Thanks can you explain to me why do I use lines in the function brea... (by bainofmyexistance)
std::to_string
 
Hi, I cannot find reference to std::to_string (C++11). Is it available on the site? If so, where? Thank you very much for the great C++ reference site, ...
[2 replies] Last: I don't think this site has anything about to_string yet. You can use ... (by Peter87)
using array to get data from txt file
 
Hi,I wanted to extract values from a txt file into an array in a program. my txt file is: 14 8 0.4 16 2.0 1.7 16 10 0.5 17 2.2 1.8 18 11 0.5 18 2.2 2.0 ...
[6 replies] Last: sorry if i sound stupid, literally started using C++ a few weeks ago. ... (by cantdocplusplus)
how to read a table from a file
 
hi plz i need a help i wanna to read this file by using arrays any one can help? 77112233 Noor Hajiri Extreme 2150.4 77223344 Ali Qudsi Extreme 3100.2 7733...
[8 replies] Last: never mind really thnx for help ^_^ (by heba1333)
Swapping Columns in a Vector Array
 
I have a simple program that takes a .csv file and produces a vector. I am then hoping to manipulate this vector in many different ways. The matrix is linke...
[8 replies] Last: If every row has the same number of fields, perhaps it would be a goo... (by Cubbi)
I don' know if it's called multitasking
 
I have a taxi-meter program in console. Now in my main menu I want to get a choice from user (1,2,3 for example). And at the time that the program is waiting ...
[10 replies] Last: tnx alot ... I'll try the first ...... :D tnx (by MirMohammad)
Ios guide
 
Can anyone advise me the name of a good book or guide to better understand the "ios" class and derivates?
[2 replies] Last: Yeah I already saw that reference but I was thinking of something more... (by fpiro07)
by Wurter
DETERMINE THE EXPECTED RESULT
 
Good day, I am a novice at C++ programming and would appreciate your comments. Regards, Werner. //DETERMINE THE EXPECTED RESULT OF 'dest' FOR THE FOLLOWING ...
[no replies]
Pointer
 
In the below function compare.. int compare (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } What is the exact meaning of *(i...
[2 replies] Last: thanks.. (by warkari)
by Smac89
How to properly use pointers
 
I wanted to try something which was to have an array filled with strings, then use a pointer to print the strings one at a time to stdout. However, I keep encou...
[8 replies] Last: Bah I thought I was the only one posting. I didn't see that like 3 ot... (by Disch)
by Smac89
Help with this segmentation fault
 
I compile with no errors, then I run this and I get a segmentation fault. When I use gdb to try debugging, I get this: Program received signal EXC_BAD_ACCESS, ...
[2 replies] Last: Thanks man, I finally understand pointers a bit more now: bool isPal(... (by Smac89)
Server and client
 
Hey rrybody, I was wondering if I could program both client and server in different languages . Let's say I program a server in c++ and a client in java . Wou...
[1 reply] : That happens all the time. As long as they observe the same protocol,... (by kbw)
by jkfde
Memory Mapping
 
How do i make a memory map of this? Address of int1, int2, int3: 0032F818 0032F80C 0032F800 Address of dub2, dub3: 0032F7E0 0032F7D0 ...
[no replies]
Removing function that isn't properly reattaching nodes
 
please help! This should just be a simple algorithm error! this is a continuation of this post: http://cplusplus.com/forum/general/87357/ This is the la...
[5 replies] Last: There are two sorts of errors, compilation errors, and logical errors.... (by TheIdeasMan)
Having some trouble with a Binary Search Tree
 
Hello, I'm writing a binary search tree for a school project, but whenever I try to call insert(), I get an access violation. I don't know why. I have test cou...
[15 replies] Last: So it looks like my final problem is in remove(). I'm not reattaching ... (by mistabob)
by zed55
How to rewrite this part of code using FOR LOOP
 
Hello, I can't figure out how to rewrite this part of code by for loop? //Project 2 #include<iostream> #include<math.h> #include<fstream.h>...
[2 replies] Last: @zed55 The fundamental problem is that you cannot compare floating p... (by TheIdeasMan)
stl error: wrong allocator coversions?
 
Have in code: std::vector<foo, TBufferedAllocator<foo> > v_foo; // v_foo.get_allocator().BufReserve(100); In particular my allocator have stat...
[7 replies] Last: Don't get. How then can i call that constructor if i know that insta... (by icegood)
by jkfde
Whats the Error
 
for an assignment we have to find errors in the code here is code int *pint; pint = new int; if (pint==NULL) *pint=100;//is this the error *pin...
[3 replies] Last: The code is saying that if pint is null, dereference it and set what i... (by freddy92)
December 2012 Pages: 1... 2930313233... 43
  Archived months: [nov2012] [jan2013]

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