time_t feed;
feed = time (NULL);
this is the part of my code that hass the error. the compiler (dev bloodshed C++) gives this error message
"31 no match for call to `(std::string) (NULL)' "...
Type: Posts; User: cppdungeon
time_t feed;
feed = time (NULL);
this is the part of my code that hass the error. the compiler (dev bloodshed C++) gives this error message
"31 no match for call to `(std::string) (NULL)' "...
The point is to store a name in a txt file, and retrieve it later, even if there are other things in the file
how can you make a string equal to a stream from a txt file?
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(){
string yay;
ofstream a ("yay.txt");
Im pretty shure this is a windows question, so im asking it here. Is there a way to save a fstream file in a different file folder than the program?
for example say my program creates a file...
i got it! thank you for your help. by the way, the point is for a user to be able to save settings even after the program turns off
Ok, heres my best shot:
#include <cstring>
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ifstream teacher;
Hello, i want to make a program that saves input as a txt, and then can read it back, and save certain portions as strings. i can already do the input, but how do you read the information? what do...
Thanks!!! i got it wo work finaly. here is the completed code:
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main(){
int a, b, c, x, y, z;
int...
This is my probem: my code should work. in fact, for small numbers it does. (like 2 and 2). but it isnt working, and it gives me one of those "microsoft error" things. please help me.
...
heres my delimma: i made a program to print a map somewhat like this: [][] (exept 10X10) each square would changes
[][] depending on what number each "square" eaquals so if...
im using it for a chess-like game more like fire emblem or advance wars.
THANK YOU!!! sorry, internet's been down for a while. anyways, specificly, somthing like this:
if(world[x-1][y]==1){
a=1;
}
then a swich/case statement to decide where it goes like : case 2...
does ANYONE use anything resembling a choice making thingie in any game they've made? im making a chess game, and i posted a tread erlier. this is different. i want to find other methods that...
heres my problem: its not working, and i dont know how to make ia, so i made...an if thingie that should work. but it doesnt. it theroreticly checks all the spaces in the vicinity of the "peice"...
a very easy way to start, is just reading the tutorials on this site (its allso free!). its all ive read, 'cept for my dads really old C book. and, if it turns out you hate and despise c++ (mebe...
oooo....neat.
i have no clue what that means, but ill look
*._. grrr...evil smiley i mean ( ; ; )
the for(;;) works...
yep
try it its kinda fun
my game isnt working...see? this is the code. it prints a board like this:
10 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
9 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
8 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
7 [ ][ ][ ][ ][...
how do you change the color in c++? :confused:
oops. im new at this...
just add a cin.get(); before the }
...try adding another cin.get(); at the ent of the file (before the "}" of course) and it chould work. i think. :D