15,300 Posted Topics

Member Avatar for NickyU

[QUOTE=NickyU;657831]I kinda want to do it my self , no DirectX. I want some help like a piece of code to explain, something more explicit than the Wikipedia article.[/QUOTE] Download the source code for OpenGL and you will find the code you want. Otherwise that wiki article looks like it …

Member Avatar for mrnutty
0
729
Member Avatar for DeathEvil

use [URL="http://cgi.sover.net/cgi-bin/bsdi-man?proto=1.1&query=modf&msection=3&apropos=0"]modf()[/URL] to extract signed integral and fractional values, then multiply the fractional part by 100 and assign it to an integer [code] #include <math.h> <snip> float fractional_part; float integer_part; float number = 999.99; fractional_part = modf(number, &integer_part); int cents = (int)(fractional_part * 100.0); [/code]

Member Avatar for 42Wired
0
190
Member Avatar for dennis.wu
Member Avatar for lahiruchandima

[QUOTE=lahiruchandima;950652]Anyone knows somewhere to learn MFC from begining?[/QUOTE] Depends on the version of the compiler you are using. But here is [URL="http://msdn.microsoft.com/en-us/library/f35t8fts%28VS.80%29.aspx"]Scribble tutorial[/URL]. There are also several good books you can read.

Member Avatar for Ancient Dragon
0
88
Member Avatar for Crushyerbones

>>Does anyone here have any tips on using inb and outb for interacting with hardware on a Linux system? Yes -- you can not use them because the os won't let you access the ports directly. >>Infact, inb(0x61) gives me a segfault. Yup :)

Member Avatar for Crushyerbones
0
190
Member Avatar for mybluehair
Member Avatar for Protuberance
0
83
Member Avatar for adamramadhan

[URL="http://notepad-plus.sourceforge.net/uk/site.htm"]Notepad++[/URL]

Member Avatar for Ancient Dragon
0
28
Member Avatar for yakovm
Member Avatar for ithelp
0
84
Member Avatar for kaninelupus

what difference does it make whether you know the rules/regulations or not? If Dani wants to keep accounts forever, what difference does it make? You can always go into your CONTROL PANEL and delete any personal information that you may have posted there. If someone wants an account deleted then …

Member Avatar for kaninelupus
-1
336
Member Avatar for pierreanthony

[QUOTE=pierreanthony;949653]hi to all.. I'm into digital recording.. collaboration..? querys on music production.? just drop me a quick message antytime.. cheers to all! -Pierre[/QUOTE] I have zero musical talent, but welcome to DaniWeb anyway :)

Member Avatar for jusvie
0
47
Member Avatar for tlentz

Welcome to DaniWeb (see Web Development forums). We have a few tutorials but you can probably find hundreds of them with google.

Member Avatar for Ancient Dragon
0
19
Member Avatar for goody11

You have to allocate memory for the string because GetDlgItemText() does not do that for you. [code] char text[255] = {0}; GetDlgItemText(hwndqw2, IDC_ANSQW, text, sizeof(text)); [/code]

Member Avatar for goody11
0
146
Member Avatar for maxbug

>>In release mode, nothing happens. Because asserts are only shown when compiled for debug mode. The same problem exists, its just that the assert does nothing when compiled for release. My guess is that the program has corrupted memory while reading the file or converting to the dialog.

Member Avatar for maxbug
0
105
Member Avatar for taikoprogrammer

In a loop just use the mod operator to switch between upper and lower case [code] int main() { char str[] = "Hello World"; int i; for(i = 0; str[i] != 0; i++) { if( (i % 2) == 0) str[i] = tolower(str[i]); else str[i] = toupper(str[i]); } printf("%s\n", str); …

Member Avatar for yellowSnow
0
4K
Member Avatar for franksmule

you can not make non-static class methods callback functions. Make the method [b]static[/b] and it should work.

Member Avatar for Tom Gunn
0
136
Member Avatar for dzhugashvili

That compiler can not compile 64-bit programs. Either buy the Pro edition or use g++.

Member Avatar for dzhugashvili
0
144
Member Avatar for The Dude

I saw a few sand paintings when I was in the UK during 1970s. Awesome :)

Member Avatar for GrimJack
0
215
Member Avatar for Ancient Dragon

Just want to announce that I am resigning as moderator due to health reasons. It was a pleasure to have had the opportunity to work with all of you DaniWeb members, the moderator team and administrators. I will continue to drop by now and then to see how things are …

Member Avatar for crunchie
0
189
Member Avatar for atch

[code] void change(A* source, A* destination) { destination = source; } [/code] That doesn't do what its supposed to do. All it is doing is swapping pointer addresses and not the objects to which they point. Therefore that function is useless. This is the correction: (Note: you may have to …

Member Avatar for kvprajapati
0
129
Member Avatar for esesili

>>Doctor::get_fee_of_doc That doesn't work because get_fee_of_doc() is not a static method. How does the patient class know who his doctor is? in Patient class you need an instance of (or better yet a pointer to an instance of) Doctor class. And in the doctor class I presume you will want …

Member Avatar for Ancient Dragon
0
84
Member Avatar for LadyAnne

Next time use code tags. The two streams are local to `Open_Files()` function, so they are immediately closed as soon as that function terminates. What you want to do is pass the stream **by reference** as parameters to that function `void Open_Files(ifstream& inFile, ofstream& outFile)` The similar fix for `Close_Files() …

Member Avatar for LadyAnne
0
146
Member Avatar for Stefano Mtangoo

Your program is already using several .lib files from the standard C and C++ libraries. If its a dll that you write and compiled, then most likely your compiler generated a lib file. If its a dll that someone else write/compiled then you might be able to get the *.lib …

Member Avatar for Stefano Mtangoo
0
231
Member Avatar for Mental1ty

Start by reading [URL="http://www.daniweb.com/forums/thread70096.html"]this thread[/URL]. Buy yourself one of the good books mentioned in that thread and start studying form page #1. You can also find [URL="http://lmgtfy.com/?q=c%2B%2B+tutorials"]lots of tutorials on the net [/URL]that will get yourself started.

Member Avatar for JameB
0
148
Member Avatar for lotrsimp12345

most likely you need to use stringstream class [code] #include <sstream> ... ... istream& operator>> (istream& in,Format& b) { //cout<<"enter's format"; string word; string line; char just; size_t count=0; getline( in, line); stringstream str(line); while( str >> word ) { b.add_word(word); count++; } // Not sure about the following // …

Member Avatar for lotrsimp12345
0
142
Member Avatar for muzhe

In order to delete lines you have to completly rewrite the file, omitting the lines you want to delete 1. open the input file for reading 2. open a temp file for writing 3. start a loop that reads a line from input file. If it is not one of …

Member Avatar for mrnutty
0
120
Member Avatar for gretty

First problem: [code] int main() { string h = "abcde"; std::reverse(h.begin(), h.end()); [/code] The problem with the second function is that the parameter is passed by value instead of by reference.

Member Avatar for mrnutty
0
202
Member Avatar for arunnic

most common way is via ODBC -- use google to search for ODBC and you will find some c++ classes.

Member Avatar for marco93
0
244
Member Avatar for gretty

line 14: where is [b]max[/b] declared? Note that [b]max[/b] is not the same as [b]MAX[/b]. You should use a <vector> instead of string array for two purposes: 1) avoid unnecessary memory allocation, 2) avoid possibility of array overflow (adding too many strings). The <vector> or <list> class will take care …

Member Avatar for gretty
0
2K
Member Avatar for jeezcak3++

You didn't post the entire program, so I assume you failed to include the header file that declared clock() function.

Member Avatar for mrnutty
1
783
Member Avatar for muzhe

Its easy -- [code] #include <string> #include <iostream> #include <sstream> using namespace std; int main() { string filename, temp; for(int i = 0; i < 5; i++) { filename = "test"; stringstream str; str << i; filename += str.str(); filename += ".txt"; cout << filename << "\n";\ } } [/code]

Member Avatar for Ancient Dragon
0
813
Member Avatar for licktress

The system() function does not accept but one string parameter, so you have to make the command all one big string. [code] string command; command = "TASKKILL " + cProcess + "/t"; // or something like that system(command.c_str()); [/code]

Member Avatar for Ancient Dragon
0
2K
Member Avatar for alvalany

>>Please provide me the solution The solution is to trash that compiler and get a modern one that is compatible with current Windows operating systems. VC++ 2008 Express and Code::Blocks are both good choices. Google for them and you will easily find the links.

Member Avatar for alvalany
0
205
Member Avatar for anakha6

[URL="http://www.apple.com/getamac/ads/"]MAC vc PC[/URL] Click the Elimination link

Member Avatar for tactfulsaint
-1
160
Member Avatar for Smoking Bros

I would think you should get the answer at [URL="http://forum.thegamecreators.com/"]their forums[/URL]

Member Avatar for Ancient Dragon
0
193
Member Avatar for tux4life

OMG! Only 16!:icon_eek: Computers had not even been invented yet when I was your age -- I was more interested in girls. Anyway -- glad you are here ;)

Member Avatar for Ancient Dragon
1
285
Member Avatar for saminchat

Sane has posted many problems that you can work on. [URL="http://www.programmingforums.org/forum64.html"]Link here[/URL] See especially his Monthly Algorithms Challenges

Member Avatar for ithelp
0
111
Member Avatar for MktgRob

Didn't bother me a bit because I don't use either :) When I want to talk to someone I do it the old-fashioned way -- face-to-face, or ear-to-ear.

Member Avatar for MktgRob
0
116
Member Avatar for rip_snoopy
Member Avatar for VernonDozier
0
114
Member Avatar for himgar

Are you sure that compiler has that limitation? If yes, then you might try using win32 api functions as in [URL="http://www.physicsforums.com/showthread.php?t=209526"]this thread[/URL]

Member Avatar for Ancient Dragon
0
116
Member Avatar for dzhugashvili

>>I have 8 gigs of ram, so I know it's not running out of space 32-bit programs can not access all that memory at one time. Each 32-bit program is limited to about 2 gig ram.

Member Avatar for Ancient Dragon
0
144
Member Avatar for happygeek
Member Avatar for ddanbe
0
186
Member Avatar for WoBinator

I wouldn't even consider java for the programs I write -- too damned slow. To me java is only useful in web development and there are probably 10 times more development environments than that. So "use only java" is just not practical or even desireable.

Member Avatar for Zacadx15
0
502
Member Avatar for aliaks

We have no clue what that code is you posted, so can't help you very much. >>Just wondering how i could go about this as I cant get the standard variable export import working with it Is this going into a DLL? What is it that you want to export? …

Member Avatar for VernonDozier
0
166
Member Avatar for spauka

You will have to write your own function. But its pretty simple [code] int main(int argc, char* argv[]) { std::string str = "Hello\\nWorld\\\\nAnother\\nWorld"; size_t pos = 0; while( pos < str.size() && (pos = str.find("\\n", pos)) != string::npos) { if( str[pos-1] != '\') { str.replace(pos,2,"\n"); } else { // advance …

Member Avatar for spauka
0
115
Member Avatar for goody11

[code] spnVqw.push_back(SPNstruct(sztempeng,sztempspn)); for(int i = 0; i < 55; ++i) inStream.getline(sztemp, 1000); [/code] I rember telling you this in an earlier thread -- that code is NOT loading the strings into the vector. All it does is read each line from the file ( using getline) ) and does nothing …

Member Avatar for Ancient Dragon
0
105
Member Avatar for Nathan Campos

you might have to go with something like OpenGL or wxWidgets, both have *nix ports (I think)

Member Avatar for Nathan Campos
0
66
Member Avatar for medopunsher

[URL="http://lmgtfy.com/?q=windows+registry+c+tutorial"]tutorials[/URL]

Member Avatar for Ancient Dragon
0
60
Member Avatar for dgr231

>>will the value of counter automatically change as well? No because they are two different variables. Line 10 only initializes the value of counter to be the same as number. From there on the value of counter does not change. >>what is the best way to create a variable that …

Member Avatar for Salem
0
133
Member Avatar for yara naser

please post the input file(s) (books.txt, tokens.txt, etc.) It appears the reading of tokens.txt is doing an awful lot of unnecessary work by reading the file one character at a time instead of using getline() to read the entire line into a std::string object. If you want to strip comments …

Member Avatar for Ancient Dragon
0
152
Member Avatar for licktress

The system function will not work for what you want to do because as soon as system() returns to your program the operating system discards the results of cd and resets the current directory to what it was before the program called system(). This is the same identical behavior of …

Member Avatar for Ancient Dragon
0
219

The End.