Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
3
Posts with Upvotes
3
Upvoting Members
3
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
~10K People Reached
Favorite Forums
Favorite Tags
c++ x 83

37 Posted Topics

Member Avatar for lexusdominus

I am a beginner with win32 programs, and am trying to integrate my console into a window. My console program starts a new thread which creates a window. [CODE]DWORD dwThreadID = 0; HANDLE hThread = CreateThread(NULL,0,ThreadProc,argv[0],0,&dwThreadID);[/CODE] i want to create a miniature output textbox within my window, which reads the …

Member Avatar for Ancient Dragon
0
213
Member Avatar for lexusdominus

Hey, so im making this game, and at the moment im using PlaySound() which is a function of windows.h to play my sound files. Ive got a problem though, i now want to be able to play more than one sound at the same time, and only now do i …

Member Avatar for predator78
0
180
Member Avatar for ravenous

similarly for me, written by my own fair hand.. [CODE]string removewhitefrom(string full) { char x; int counter = 0; string processed; for (int t = full.size();t > 0; t--) { x = full.at(counter); if (x != ' ') { processed.push_back(full.at(counter)); } counter++; } return processed; }[/CODE]

Member Avatar for Narue
1
2K
Member Avatar for lexusdominus

Hey, does anyone know which function/s i need to use to copy a file from one subdirectory to another, without changing the name? im on windows if that helps.

Member Avatar for WaltP
0
146
Member Avatar for lexusdominus

Id like to have my console program stopped and code executed if a timer runs out. does this mean i need another thread? can anyone point me to some functions i may need to use as ive never forked a program before. im using visual c++ on windows.

Member Avatar for Tellalca
0
516
Member Avatar for lexusdominus

Hey, ive got a problem. i cant seem to get Playsound() to work. Ive searched google, and alot of people say to go to properties - all configurations - linker - and add winmm.lib to the additional dependencies to link it. ok, so i did that, have included mmsystem.h, but …

Member Avatar for lexusdominus
0
97
Member Avatar for lexusdominus

[CODE]if ( initialize == "off" && Iminor > 20 || Imedium > 10 || Isevere > 5 || Ifatal > 0 )[/CODE] the string type 'initialize' is cout'ing "on" and all of the values right of the AND operator are TRUE. Why is the subsequent code block for the if …

Member Avatar for lexusdominus
0
129
Member Avatar for lexusdominus

[CODE]int thetime = time(NULL); string in; stringstream out; out << thetime; in = out.str();[/CODE] that's my code for casting an integer into a string, but im having a little trouble reversing it to change a string into an int. :/ can anybody help me out? you have to include the …

Member Avatar for lexusdominus
0
69
Member Avatar for lexusdominus

Hey, ive got two string types [CODE] string string1 = '1'; string string2 = '2'; string string3 = string1 + string2; [/CODE] Ok, ive simplified my code. I would like string3 to equal '3', and not '12'. I dont know anything about casting. Please dont tell me to use an …

Member Avatar for lexusdominus
0
121
Member Avatar for lexusdominus

Ok so ive written a console program which is great, and now i want to create a thread that makes a window (winAPI) and can commuunicate with the console window. Well to describe it properly, i would like the window thread to send predetermined text (by clicking buttons) to the …

Member Avatar for octopusgrabbus
0
93
Member Avatar for lexusdominus

Ok, so ive had this really annoying problem with Visual C++. It bugs me because it doesnt make any logical sense. something i guess we need to program. Anyway, Visual C++ reckons that the datatype "string" isnt defined, even though it is in the included library string. If i right …

Member Avatar for lexusdominus
0
126
Member Avatar for UltimateKnight
Member Avatar for VernonDozier
Member Avatar for Ezzaral
2
210
Member Avatar for Sundayy

david is correct. Also you are trying to use Total_Number_of_Seconds before it has been initialized. Fill the variables after you have the value to fill it with, not before.

Member Avatar for Sundayy
0
788
Member Avatar for lexusdominus

Im trying to learn how to use the winapi - ive read tutorials about message handling and the windows procedure ect, but am a bit lost as to where to start. I know what i want to do - my program launches as a console and starts a new thread …

Member Avatar for Ancient Dragon
0
160
Member Avatar for Tripandthenfall
Member Avatar for gerard4143
0
86
Member Avatar for KazenoZ

yeah i think a shell script would do the job. Hamilton C shell was developed for windows. i cant be more help in that respect - ive never written a shell script. What about system()? cant you use that to run your compiler?

Member Avatar for KazenoZ
0
147
Member Avatar for Tuloa

I've done this before. do you want it to take a specific line or just have it return the first and only? This is the first version of my function. i have another that can return the line only if it starts with a specific substring [CODE] string getfile(string file, …

Member Avatar for Tuloa
0
200
Member Avatar for Sahilroy
Member Avatar for techsurge
-7
124
Member Avatar for lexusdominus

i wrote this a couple of years ago when i was just starting to program. i didnt know any professional programmers and wanted to learn, so just experimented with the language. maybe it will give you an insight into how people program for fun. feel free to add to it, …

Member Avatar for mike_2000_17
0
139
Member Avatar for Sundayy

i totally agree with appropriate variable naming too. i far too often find myself stuck debugging only if i had just used better variable names the problem would be easier to isolate. It also helps other people read and understand your code when you ask for their help.

Member Avatar for peter_budo
0
446
Member Avatar for lexusdominus

i have a string which is giving me problems. when i put it into a textfile, it puts the cursor onto the nextline. i assume because there is a \n at the end of the string, but when i cout the string, the newline character isnt there (well, the console …

Member Avatar for lexusdominus
0
98
Member Avatar for lexusdominus

i would never ask for debugging help usually but i am totally lost and have wasted far too much time on this. both peices of code compile correctly. the original function works fine with my program and the second one crashes. the original code checks a textfile in the root …

Member Avatar for lexusdominus
0
318
Member Avatar for Scooterman1

the string library is amazing. create an array of the size of the string then loop through the string and copy each element into the array [CODE] #include <iostream> #include <string> #include "windows.h" using namespace std; int main() { string imastring = "i am a string"; char array[imastring.size()]; for (int …

Member Avatar for Scooterman1
0
382
Member Avatar for lexusdominus

Hey guys. Im writing a console based application which i want to convert to a windowed application. however, i still want the user to be able to type in input and for my program to be able to output in a console based style, i'd just like the option to …

Member Avatar for lexusdominus
0
211
Member Avatar for juangalvez4

a for loop is very useful. It will loop through the code contained within the curly braces. [CODE]for(::) { cout << "loop"; }[/CODE] there are three sections that control the for loop. for(1:2:and 3) 1. You tell the for loop to use this variable to control it. you can either …

Member Avatar for juangalvez4
0
134
Member Avatar for hodaAgh

[CODE] 1. int main () 2. { 3. . 4. . 5. . 6. . 7. 8. 9. ifstream file1; 10. ifstream file2; 11. ofstream simiralities; 12. simiralities.open("P(0)_P(1).txt", ios::app); 13. file1.open("test1.txt", ios::in); 14. // A good way to check if a file has been opened- if (! file1) { cout …

Member Avatar for hodaAgh
0
146
Member Avatar for lexusdominus

id like to write a function that checks if an object's variables have been changed. the only way i can think of is to create a duplicate object and compare each variable. im really lazy, and this seems like alot of effort. can anybody help me think outside the box? …

Member Avatar for mrnutty
0
103
Member Avatar for davebaum1

Ive only ever used one book with c++ [url]http://www.amazon.co.uk/Programming-Easy-Steps-Mike-McGrath/dp/1840782331[/url] its dirt cheap & covers most topics. I only use it for reference though, i think you can only really learn c++ properly by messing around with it. :)

Member Avatar for tundra010
0
169
Member Avatar for athlon32

I use a mixture of both, if you stick a "\n" in a file it will put the next bit of data on a newline. I think endl is just for console output. its probably good to get used to using "\n" as there are other escape sequences too, like …

Member Avatar for athlon32
0
278
Member Avatar for mybluehair

You are going to have to look into socket programming i think. ive never done it myself, so i cant really say much on it, but i think its dependent on the platform you're using.

Member Avatar for lexusdominus
0
158
Member Avatar for lexusdominus

Id like to edit a file. At first i thought this was going to be easy, but now it appears quite complex. As i understand it there is no standard way to delete part of a file? im storing data on different lines in the file, and want to target …

Member Avatar for siddhant3s
0
120
Member Avatar for lexusdominus

Im having some problems organising my code in a large (for me) project. Basically my problem stems from having 1400 lines in one source file. Ive written 38 functions which all have declarations above the main function. Below my main function block i have all of the function definitions. Im …

Member Avatar for lexusdominus
0
158
Member Avatar for lexusdominus

Hey. I have to say this is the first time ive been totally stumped by c++. I cant exit this loop. this code is from a function that takes a string filename, an int mode, and a char print. It takes a textfile looking like this: somesite.netinfoaboutsomesite someothersite.orgdataonsomeothersite yetanotherrandomsite.edurandomchars and …

Member Avatar for lexusdominus
0
142
Member Avatar for lexusdominus

Im developing software that will handle alot of files & i was wondering what the best way of doing this is. There's a couple of things that are important. 1) i want to be able to access the files easily and have them grouped. 2) i want the files to …

Member Avatar for csurfer
0
277
Member Avatar for lexusdominus

Hello! google has turned me up at this forum so many times i think it would be stupid to ignore the hints & not get registered! Im having some problems with objects. Here is my code: [CODE]#include <iostream> #include <string> using namespace std; class planet{ public: int moons; int mass; …

Member Avatar for lexusdominus
0
140
Member Avatar for jondsam

At the end of your cout << i++ << endl; end1 should be endl. it ends the line & puts the cursor on the next line. your compiler should give you the line of the error to make them easier to find.

Member Avatar for lexusdominus
0
115

The End.