General C++ Programming - January 2011 (Page 6)

by Icenel
How to use strtok
 
Hello, please help me... I have a problem with strtok char a = "1.2"; I get number "1" use printf("%s", strtok(a, ".")); but how to get number "2" w...
[2 replies] Last: Simply put, it splits a string into tokens when the delimiter is reach... (by closed account zb0S216C)
by Icenel
How to use strtok
 
Hello, please help me... I have a problem with strtok char a = "1.2"; I get number "1" use printf("%s", strtok(a, ".")); but how to get number "2" w...
[1 reply] : Try this: #include <cstring> #include <stdio.h> char a[ 5 ] = ... (by closed account zb0S216C)
Classing problem
 
How do i get this to randomly throw out 1 of the text in the eightBall class #include <iostream> #include <stdlib.h> #include <time.h> #include <math.h> ...
[3 replies] Last: I don't understand what you want. Why not just add cout << iSecret? ... (by Browni3141)
Reade first character of each row file txt
 
Hi, i'm new on this forum and on c++. My target is to read a input file of this type: 9 10.1.1.9 10.1.1.1 3,500000 00:00:00:00:09 00:00:00:00:08 7 and...
[4 replies] Last: You could do this: #include <fstream> #include <stdio.h> bool ... (by closed account zb0S216C)
some problems this text cleaning program
 
hello everyone, what this program is supposed to do is to get text from a file and remove all weird characters (1234567890!@$#%^&*) and then output the cleaned ...
[2 replies] Last: to read 1 char at a time does the only thing that needs to be done is ... (by vouslavous)
Deleting
 
I want to delete a part of file not the complete file . How i can do it using file handling.
[3 replies] Last: Actually i am trying to sort a file with integers written into it . I ... (by iit2009154)
pass class to function fail
 
ok so i have a function that i want to use an object as input for but when i do nothing happens the function doesn't execute but no errors appear. so anyway her...
[11 replies] Last: ne555... Thank you for posting that article. It was a very interest... (by sadavied)
recursive program to raise number to power
 
I have to write two files, one is a header and the other a file that calls that header to run the equation. The problem I am having is that I do not see a resp...
[1 reply] : you've got some syntax issues here... check out the beginners guides t... (by ceruleus)
Empty strings
 
Hi all C++ programming fellows Making some experiments with string objects I've seen what I think is a confussing behaviour. If you want to create an empty st...
[5 replies] Last: Grey Wolf you're so wise! (by ceruleus)
by wgnwpu
How to stringize a string with comma in it?
 
#define CSTR1(a) #a #define CSTR(a) CSTR1(a) #define CLASSNAME_TEMPLATED(className, param1, param2) \ className<param1, param2> int main() { cout <<...
[1 reply] : Use an extra set of parens: CSTR((CLASSNAME_TEMPLATED(map, int, ... (by jsmith)
How to install systemC under tdm-gcc
 
As the title, I would like to install systemC 2.2 on mingw But I don't know how? OS : windows xp sp3 compiler : htp://tdm-gcc.tdragon.net/ I spent sever...
[no replies]
by Sam034
What should I learn next?
 
Hey, I was wondering if you guys could help me. I just finished this book called "C++ All-In-One For Dummies( the 7 books in 1 edition)." It was about 800 pages...
[11 replies] Last: It seems like SFML is the first library I should learn. There are ... (by Sam034)
reallocate with new
 
hi all i have a class with a table inside the table takes memory with new in some cases the table could take a bigger size and i want to reallocate the mem...
[3 replies] Last: I don't know what copy is doing (I hope it creates elements as well as... (by kbw)
problems with online checker
 
do anybody know why my program is not working corectly i still have wrong answer. i am sure that the algorithm is ok because on all test he was giving good answ...
[3 replies] Last: It seems to me that you miscalculated t = sqrt( g*h/2 ) while it shoul... (by hamsterman)
by sbyres
Reading from a file
 
Hey i'm in desperate need of some help. I'm doing my Advanced Higher Computing project for school, and my programming has come to a complete halt. What im tr...
[3 replies] Last: Thanks for the replies. My code is now compiling, but it hangs when re... (by sbyres)
some problem about boost::thread
 
hello everyone. I'm a new user of boost thread. I use boost thread to write a multithread program. In my program, I wrote a GameManager class which manager...
[no replies]
why is long double so slow?
 
The following code is at least a factor for 10 slower with F typedefed to long double as opposed to double. Simpler loops only seem to take a 30% hit. Anyone ha...
[4 replies] Last: sizeof( long double )=16 sizeof( double )=8 That's not what I expe... (by gwpatrick)
Is there a way of knowing whether a text file is opened by another application?
 
The question I suppose is clear. Another application is not mine. It is writing some data into a .txt and I'm trying to read it asynchronous
[1 reply] : I guess that you could check the timestamp of the file. In linux you... (by ne555)
by DOSIX
making a timer
 
i'm working on a timer that counts down from a set number of time until zero. i just don't understand clock() or the CLOCKS_PER_SECOND macro. how would i make t...
[2 replies] Last: alright thanks. (by DOSIX)
hex2bin issue
 
Hello, I have a faulty hex2bin function here, and I'm wondering if anyone has suggestions to fix it. std::string hex2Bin(std::string &input) { std::ostr...
[4 replies] Last: I have another update, maybe it can be solvable this time. It appears ... (by Phantom139)
January 2011 Pages: 1... 45678... 24
  Archived months: [dec2010] [feb2011]

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