what about type 'long long'? i don't have a compiler here, so i cannot check it. But in some compilers (Borland for DOS maybe)
this type is also available. (my compiler takes even 'long long ......
Type: Posts; User: mazo
what about type 'long long'? i don't have a compiler here, so i cannot check it. But in some compilers (Borland for DOS maybe)
this type is also available. (my compiler takes even 'long long ......
Your piece of code is too small.. we don't know what pa[] and qa[] are, maybe they are too small so the index k is out of range (i don't know what relation is between m and size of these arrays)....
Hmm.. for positive integers it's working really, but what if some of given operands is negative? I think that then % operator returns the value, for which this is true: (a/b)*b + (a%b) = a. (maybe I...
Maybe you can study something about basic data structures, like array, heap, binary tree, linked list.. I recommend you to read essays on www.aihorizon.com or maybe you can find something on this...
Thanks a lot, Hammer! I have fixed my bugs(like follows down here) and it's working now excellent!
else if (argc == 2) {
in.open(argv[1], ios::binary);
char *filename;
filename =...
I tried to write a simple XOR encryption program. But it's not working properly. For some files is the output file longer, for some other shorter then it should be. Here is my source code:
/*
...
And maybe you don't need three for statements.. only some math :)
the numbers
z=p^2 + q^2
x = p^2 - q^2
y = 2*p*q
are pythagoric for two positive integers p,q (p > q).
(you can prove it...
Soccer is good.. in Slovakia are a lot of people fans of soccer..
But hockey is better :) We are the champions :cool:
It creates array of 10 sizeof(char), so 10 bytes usually.
If you want to use '\0'(and you have to, if you want to use that array as string), it contains only 9 useful characters, so if you are...
I dont know why it is here.. but I think DOS has only one big disadvantage: I cannot allocate more then 600k of memory..(borland c++ 3.1)
But with djgpp and linux compilers (gcc, ..) maybe all...
I dont know what that previous algorithm is doing.. but you can use some fast XOR encryption algorithm, few of them you have here:...
Hmm.. I think that code which is using CDROM isn't for newbies..
structs like cdtype or what you are using are too complicated for me :) (maybe I'm also a newbie..)
I think you could write some...
Ok. I have created some .h file, it contains declarations. But where can I put definitions? They must be in some .cpp file, I think. For example function bodies will be in that .cpp. And how can I...
A loop.. so:
int menu()
{
int x;
cout << "What do you want?";
cout << "1 - exit\n" << "2 - continue"<< endl;
cin >> x;
It seems good, using ' '(space) instead of system("cls");.
Maybe it will be better to use one switch instead of four if statements, it will be much more readable..
(and also shorter :)
Sorry, but I really don't know what is flowchart(I'm from Slovakia, so nothing to wonder..)
And what is 'using namespace std;'? My compiler doesn't know how to compile it :) I guess it's something...
I think you have some mistakes in your code:
** #include <conio.c>
What is conio.c ??
And here in your code you don't have a semicolon:
** cout << "This will be blue"
And also on Borland...
There are many ways to make a pause before exiting a program.
You can include <conio.h> and then use
while (!kbhit()); or <stdio.h> and getchar();
In DOS you can use sleep(int...
So, it's not bad. if you want, I can post here my own RPG game. It's a bit different than yours, and without help hardly playable ;)
Because I'm used to play my realtime RPG (maybe its turn-based,...
I'm not a guru, I have to learn really a lot :) , but I think it's about basic concept. If you are creating a big program, you should choose between some basic concepts: object programming, modular...
scanf("%d", &temp_s.reorderLevel);
if(temp_s.reorderLevel != NULL)
(*new_s).reorderLevel = temp_s.reorderLevel;
What is temp%s.reorderLevel?
If it's a pointer, then the scanf won't work(you...
Of course there is another way, it depends on your system, for example which compiler and IDE you are using.
In Linux with gcc you can compile source in *.cpp to object *.o files and then compile...
You include building.h in your main, but I think you don't include building.cpp so functions defined there isn't available in main.cpp, you have only prototypes..
I have seen some nice one-line functions for toggling Caps Lock on/off, maybe here: http://www.cprogramming.com/source/caps.zip
Problem also can be in some pointers, e.g. you use index n in n-element array which is indexed from 0 to n-1. This will give pretty amount of different output, depending on nearly everything..
I...