Yes, this is a console app (i know what it is lol). I need to write to a text file that already has text in it. I need to insert something into the middle of it pretty much, but without writing over...
Type: Posts; User: Gnoober
Yes, this is a console app (i know what it is lol). I need to write to a text file that already has text in it. I need to insert something into the middle of it pretty much, but without writing over...
I need to figure out a way to move the cursor in "ios:: out" mode without overwriting stuff. The problem is that I need to move by the line, not by the character. Is there any way to do this? Thanks...
I too am writing a text game but not really for the actual game so much as for the practice. Anyway, I'm trying to get a high score list up an going but I'm stuck... I can find where the new score...
I figured it out, if anyone was working on it. The problem is that "i" is never reset back to 1 in the loop. Thanks for all the help guys!
Getch() may be what you want. You can just say something like:
char ch=getch();
but I don't know about arrow keys. Maybe someone with more experience could help you out.
I'm doing the high scores by myself. If anyone has any tips on how to do high scores more efficiently, please help me out. Maybe a different format of the text file or something...
This function finds the lowest number and I run it before I run putit().
void lowestnumber(){
int i=1;
File.seekg(ios::beg);
while(i<oflines-1){
I'm working on a function that seeks out where a high score should go in a text file. For some reason it loops until it gets to the highest number in the list. Here is the contents of "data.txt" and...
Geez, I feel like an idiot... Thanks Magos!
I need to know how to read a number in a text file as an integer, not a string. The number is on its own line which makes it easier I'm sure, but getline() takes a "char" as an argument. I have tried...
TempInLine is a char[256] and as far as I can tell, getline() is what I am using...
For some reason the function below clears my entire file. I don't know if getline() clears what it gets or if something is wrong with my code. Either way, I need to figure out a way to count the...
I am really in a bind here trying to implement high scores into a console app. I just don't understand file reading and writing. The books I have don't cover it very well. Here's some psuedo code,...
To implement a string array, use pointers to char arrays.
Example:
char a[], b[];
strcpy (a, "STRING1");
strcpy (b, "STRING2");
char * c[];
This could be a stupid question... but how do you know which line getline() is getting?
Never Mind, I got it to work. I made a stupid mistake and didn't add the resource file to my project:rolleyes: . Thanks so much for all the help!
Ok... It isn't working:(
here's my code:
LoadIcon( GetModuleHandle( NULL ), MAKEINTRESOURCE( "icon.rc") );
I have the resource file created and it compiles just fine but the icon...
So in the main, I should just type
LoadIcon(nameOfResource);
It seems too easy:) Maybe I'm missing something
Correct me if I'm wrong because I am new to C++, but if you declare and integer type, any number assigned to the variable will automatically be truncated into an integer.
Example:
#include...
I'm not sure if I understand...
Heres what I get out of that:
I must create a WMDCLASSEX object and then use
object.hIcon = LoadIcon();
Is that linux\unix specific?
Does anyone know where I could find out how to link resources to my program (in windows). I can create the resource file but I'm not sure how to get it to link to my program. I have created an icon...
edit: I guess I answered his question about the same time Magos did... sorry;)
I have forgotten where I found this... but it is a header file to use the clrscr() function in C++. Just save the file into you compiler's "include" folder and when you want to clear the screen type...
I can create the resource but is there a command like
#include <blahblah.rc>
that I should use to link the resource to my app?