By the way, you don't have to declare a new variable. You can just do if (ans==42).
If you want to get more complicated, you could use two arrays to store a bunch of easter eggs and call them with...
Type: Posts; User: verxintRising
By the way, you don't have to declare a new variable. You can just do if (ans==42).
If you want to get more complicated, you could use two arrays to store a bunch of easter eggs and call them with...
Changing it to a Win32 GUI project in Code::Blocks didn't do anything. Also, it is compiling with "-lcomdlg32", so that's not the problem.
I've also seen plenty of console tools that can open a...
Where exactly do I put that? I don't see it in the source code I got from the place UltraKing linked.
Well now that I have a vague grasp of how to use this function.. I'm now getting an "undefined reference to GetOpenFileNameA@4" error when I compile.
1. Never thought of that but it's a good idea. I never had a problem with using pointers for dynamic arrays, so I always did that.
2. Didn't know the at() function existed/was preferred.
3. This is...
find.cpp
void find(vector<macros> &m, file &f)
{
char *c_file;
c_file=new char[f.oldLength()];
f.oldFile().copy(c_file, f.oldLength());
for(int x=0;x<f.oldLength();x++)
{...
How do I create one of those explorer windows for choosing a file to open? I'm guessing its some WinAPI function but I have no idea what it is. Thanks.
Okay, I've tried writing something, but now I have lots and lots of wonderful errors.
global.h
#include <iostream>
#include <cmath>
#include <vector>
#include <ctime>
using namespace std;
Alright, I did some reading and I think I'm starting to understand how to use references to get around global variables.
void addNewEntry(std::vector<db_entry>& data)
{
...
I don't know anything about references, but I do understand pointers.
I'm wondering though, why are global variables bad? I've used them a few times and I don't see what can go wrong. And since...
I've found in my programs that if the user puts a number larger than 2147483647 (32 bits with all but the leftmost bit as 1) into an int (using cin>>), the program skips over any cin>> anywhere else...
Alright, im getting this now.. I'm a bit neurotic about using code I don't understand well so bear with me..
back() references whatever is the last value in a vector (or array?). So in this case,...
Hooray, more code I don't completely understand xD
1. what does back() do? how is it different from push_back()?
2. With your function, what would I use to output? would it still be...
So if I'm understanding this right...
#include <vector>
int dbSize = 0;
struct db_entry; //creates structure
{
int value1;
That might be what I need.. would it be possible for that same method to be put into a function so a class can be created at the user's request?
Edit: Lemme make sure I follow this, cause I don't....
Wordy title.. Lemme try to explain better.
I'm trying to design a database-like program to see how well I can use file input/output, menus, and other stuff I've been working on in one single...