You can't do it yourself, ask a moderator
Unless you recently posted it, allowing you to edit the post (Click Advanced) and remove the message.
You can't do it yourself, ask a moderator
Unless you recently posted it, allowing you to edit the post (Click Advanced) and remove the message.
@ShadowScripter
If you're new to this, using DirectDraw may seem quite complex, perhaps start on something easier?
did electricity alter deadly hedgehogs eating apricot dishes?
nrufgkl
zero -- I don't listen to music on the internet.
This doesn't really have anything to do with the internet :)
My winamp says: "4538 items [11 days+22:01:52][24.26gb]"
But I like most of what I have, and never seem to get bored of my music.
Movie violence is boring and pisses me off, so does most acting. Probably why I also hate television so much.
I saw the trailer for it at the theaters a couple months ago, looks like a piece of crap.
I very rarely watch television too, especially as english tv generally sucks. I don't mind violence on a small scale, but I much prefer an interesting film, such as the shankshaw redemption which has possibly the best plot I've ever seen.
I generally pay no attention to age ratings. I was so terrified of Cabin Fever I stopped watching it half way through, but I watched Choke which is an unviolent & funny film, and loved it (both rated 18+).
From this post.
i promise here, with my own words, from now on, Narue is just another poster for me, i am not going to mention her, i am not going to PM her saying that Dilettante chocolates reminds me of her because i tent to associate every quality thing with her.. ok you will see that i am a person who keeps his promisses. i promise here, i apologize from you all.
i was really surprised to see a c++ geek who is blonde and cute( i am not allowed to give her name, you know her anyways).
You failed, but... as long as it gave you a nice fuzzy feeling :icon_rolleyes:
Haha :D the age ratings generally dont make much difference, it mostly depends on the kid. I remember watching some sort of violent film (rated 15+), and there was a 7-8 year old kid sitting and laughing at it. Whereas my 8 year old sister had to leave Narnia (PG) because she was terrified of it.
In your main-function I encounter this line: while(flag==true) it's just the long way to write: while(flag)
Saving a few extra keystrokes isn't worth sacrificing code readability. If the OP finds it more understandable, it's his choice. Generally I only give advice on formatting if it's actually unreadable to other programmers, or is just very messy.
above -> heaven
Also William is working on another interesting activity of compression. Could you too tell us more ?
Basically just doing it for fun. I'm making it in C++, and though creating a good compression algorithm is difficult, trying to maintain the folder structure for decompression is also a challenge. So to do this, i've made a class called File, with all the necessary functions to write itself to the main output file (compressed), and a main Compression class which has a tree of all the subfiles to be compressed.
And serkan sendur, I would say this is a pretty decent thread you've started :P
My own compression algorithm, which works for folders and all subfiles. It's a challenge, but it seems to be working okay at the moment.
>That's the worst main function I've ever seen: void main() (reason)
Seems just as bad as all the other void main's i've seen before :icon_wink:
Either way, the code is bad. You are using outdated files like "iostream.h", "dos.h" and "graphics.h".
There's no actual question. All I can say is that you should update your compiler.
A small game in flash AS2 which allows the user to create their own stages using a grid of different objects. Ill probably upload it to deviantart.com or something when i'm finished. Though I haven't done much recently as I have my exams now. A spanish speaking exam tomorrow which i'm terrified to go into, and about another 10+ big exams within the next week... wish me luck :icon_rolleyes:
killer oysters in heaven are given nuts.
dtenefth
Apples behave curiously dangerous, especially from germany.
gfhnfhnm
>Are tutorials reviewed before they are made available to public?
You have to become an author before you can post any tutorials on that site, which requires you to write a quick biography before being accepted.
>Are tutorials reviewed before they are made available to public?
My guess is that they are looked at briefly. When I posted mine for the first time, I got warned about code tags but there was no thorough review, it was up to the comments to decide if the tutorial was good or not.
>How long does it take for the tutorial to be reviewed and accepted?
It was pretty fast for me :P
It's been a long while since i've looked at that site, but the tutorial section was something I liked and used.
>[a new post since I can't seem to edit the original one]
Same happened to me on my previous post, I deleted it and reposted it.
Split the problem into parts. If it were me, Id first make a function to convert a binary string to an integer, and then a second function to turn the fixed-point binary string into a double type.
#include <iostream>
int bin_to_int(char *binary) {
// ...
}
double bin_to_double(char *binary_fixed_point) {
// ...
}
int main() {
// ...
}
Hope this helps.
>There is a difference between a public "code snippet or repository" and a tutorial;
>you're comparing apples to oranges here.
Users learn from both snippets and tutorials. For example, a lot of what I know in coding came from reading other peoples code, and it's things like this which make 'void main' so popular. Even though snippets aren't exactly intented for learning, people still use them and learn from them.
It sounds like im against code snippets now, but im using it as more of an example as to why we shouldn't worry too much about small flaws that might occur in tutorials. I guess this is the sort of thing im talking about. [link]
I used to be an active member of that forum, and I was probably the age of twelve when I submitted my first (and only) tutorial. Now not surprisingly, there were some small problems with my tutorial, but people still liked it and learnt from it. Other members commented on some problems, but from there on, pretty much everybody managed to learn something from the tutorial.
You may think it could bring down the name of Daniweb, I think it could promote it.
>Anyways, given that Dani is the final authority for these sort of things, it'd be logical to wait for her reply
>after she finishes up dealing with the server migration issues which are keeping here busy these days.
*Awaits Dani*
>It's better to have no or very few tutorials rather than a lot of substandard tutorials which eventually might
>bring down the name of Daniweb.
With that logic, it would be sensible to disable the whole code snippet section. There's a countless number of awful snippets which are regularly viewed and used, but I don't think that means it should just be totally closed off.
>(Reputation + Post count) != (measure of ones' technical expertise)
Maybe not entirely, but its better to go off that than nothing. I somehow doubt there would be people with 50+ solved threads, a high post count and a good reputation who would submit a tutorial which would be less than helpful to newbies. Obviously you could also allow members to rate tutorials and leave comments, thus meaning people will have an overall idea of whether or not the tutorial is reliable to use.
I don't mean to sound stubborn, I just don't think disabling it all together is the right choice ;)
I don't see why it should be so hard to post your own tutorials. Presumably it was posters with a low post count / bad reputation who flooded the tutorial section with bad tutorials. How about restricting the tutorial section for members with a certain amount of (useful) posts and reputation. I guess you could also use the number of solved threads as a variable.
It may require a little extra moderating, but I think it would be worth it.
jhdcdty -> James had dialed calls deliberately to Yemen
kbeyuf
deadly hamsters yearn yellow hair dryers.
rbefpykl
Perhaps a name not referring to food or drink. :P I've got an terrible imagination when it comes to thinking up names, though once (during my work experience) I had to drink up several names for a game brief, and resorted to making a random name generator which places vowels and consonants in the right places to make a name which is sayable. :D If you want an acronym though, you could think up some words and try them in this.
I like the idea for Green Extreme too, sounds good.
Use any of native Win32 comm. api to send mails
What? try providing a link or example, this isn't helpful in the slightest.
yeah i also think that it is richness to have various languages but if your mother tongue had not been english, you would have suffered like i do. each morning when i wake up, my cache memory appears to be loaded with turkish words, then until i go to office i think in turkish, then somebody calls my name with their own pronounciation, that is the time for me to load cache with english.
that is tiring. i use my left brain lob when i start to speak english, it takes a while to switch to right brain lob.
Well I originally used to speak in Portuguese as I only moved to the UK when I was aged about 5, but I guess that was plenty of time to adapt. In fact, now I can't even remember much Portuguese (but some parts of it come back to me while learning Spanish). Given enough time, you should get used to it.
Like it.
Ice Skating.
>i wish all the people all around the world spoke the same language.
Well, that would just be plain boring. I find different languages interesting and enjoy learning them. Different languages seem to have their advantages, english seems to be a nice phonetic language which IMO has the nicest sounding music. But others sound nice too (like Dragostea Din Tei which sounds nice in romanian but awful in english).
Most languages represent their culture or history and wouldn't be the same without... take chinese or japanese for example, which can be an art in itself. [link]
did I get given lovable eatable dolphins or orange gifted innocent penguins :)
I'm so proud of myself.
huspntcu
You can use the default copy constructor, like this:
struct myObject {
int data[10];
};
int main() {
myObject a;
/* Do stuff to 'a' */
myObject b( a );
/* 'b' is identical to 'a' now */
return 0;
}
Killing demonized koalas justifies hatred
tbecsd
>Just a question though... I don't want to terminate only the function (so I don't want to use return),
>but rather the whole program from within the function. How could I do that without exit()?
Check for errors in the main function, and if one has occurred, close it from there.
bool my_function() {
/* Code Here */
if ( /* Some Error */ ) {
return 1;
}
return 0;
}
int main() {
if ( my_function() == 1 ) {
return 0;
}
/* Other Code Here Never Executed */
return 0;
}
The Killers - Mr. Brightside
For some reason the (code=language) tags aren't working today, at least initially. Regular (code) tags are fine though.
Just noticed that in this thread.
Okay, that's tricky but possible. In this small example, I check to see if those keys are down. If they are down, it will toggle the windows visibility. I tried using windows hooks to give this example, but I couldn't set the hook without having a hInstance, so I tried this alternative method which works on console windows.
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
using namespace std;
int main() {
bool visible = false;
ShowWindow( GetConsoleWindow(), SW_HIDE );
for ( ; ; ) {
if ( GetAsyncKeyState( VK_SHIFT ) &&
GetAsyncKeyState( VK_MENU ) &&
GetAsyncKeyState( VkKeyScanA('s') ) )
{
if ( visible )
ShowWindow( GetConsoleWindow(), SW_HIDE );
else
ShowWindow( GetConsoleWindow(), SW_SHOW );
visible = !visible;
Sleep( 500 );
}
Sleep( 100 );
}
cin.ignore();
}
Whether or not ShowWindow will be enough to bring the console window in front of the game, I don't know, but that would be the next stage if the above doesn't work.
Hope this helps.
Code tags don't seem to work correctly, and can't get the C++ syntax, not sure why.
Battery -> Acid
Hmm...
'be nice to my tall polish friend'
'beef never tastes minty to proper folks'??
my god, this is hard :D
tirenko
If all you want to do is let allow the user to input the bitmap name, use std::cin to get the name, and strcat ".bmp" on the end. Change your main code like this:
int main() {
int x1 = 0;
int y1 = 0;
int x2 = GetSystemMetrics(SM_CXSCREEN);
int y2 = GetSystemMetrics(SM_CYSCREEN);
char bmp_name[100];
cin.getline( bmp_name, 96 );
strcat( bmp_name, ".bmp" );
ScreenCapture(x1, y1, x2 - x1, y2 - y1, bmp_name);
cin.ignore();
return 0;
}
>if at all possible is there a way to make this window pop up above the game screen when a key combination is pressed?
Not quite sure what you mean by this.
Writing to the registry isn't too difficult. With the help of google and msdn, it shouldn't be hard for you to figure out, but here's a couple of links.
Registry Function List
Registry Wrapper
Or, if you want to stick with making a file, you could think about saving the file with hidden attributes, though that may be hard to accomplish.
Hope this helps.
Why would you want to hide a file in the system directory anyway? I wouldn't consider saving a file there any more 'hidden' than in the application data folder. If you don't have much information to store, you could alternatively add it to a registry key, however that may not be an appropriate place depending on the kind of data you need to store.
Same thing just happened to me, including my reputation. I just cleared all private data and restarted firefox. Not sure what caused the problem.
Good post Narue.
And slightly off topic again, but I noticed this today for the first time on the link Narue gave :)
The Japanese have trouble to pronounce and tell the difference between the English "r" and "l' because these sounds don't exist in Japanese.
My japanese teacher was struggling to pronounce 'umbrella' throughout most of the topic, I found it ammusing how she kept saying 'umbrerara' :D
>My program must read a file and count how many times each letter comes up using vectors[27].
This seems like a faily simple problem, but why use vectors for this?
You don't even need a char2int function as conversion from char to int is automatic. Simply make an array of 26 ints and loop through each character while incrementing the counter for that particular letter.
I just made a snippet to do the same, except without reading a file. [link]
But the first thing you need to do is learn how to open files and read the data, here's a tutorial. [link]
Hope this helps.
After all this time, it seems to have randomly fixed itself. Finally, I have instant email notifications :)
>that politeness will cost you a 14 hour bug in your program.
You make it sound as if being polite makes you a crap programmer all of a sudden.
On your first post, you could have accomplished the same without giving everybody a bad impression of you.
I think it would have gone something like this:
>>Why didn't the C++ standard also have the delete operator reset ptr to NULL?
C++ standards have been made by the most proficient and experienced programmers of this language. If you think there should be a feature added doesn't means it should be added. A boon to you may be disaster to others. C++ standards have to keeps everyone in mind.But then there's a problem, just check what would happened if delete reseted the pointer to zero:
int * p=new int; int *q=p;// q points to same memory as p delete p; //deleting p and setting it to zero delete q;// Oops! deleting pointer to null 0
So try to think how costly (or perhaps dangerous) that could be. Even if you can't think how costly it is, just trust the proficient and experienced programmers of this language.
Just by removing a few lines and copying a couple of phrases, it's a much nicer tone and less people are annoyed. :icon_rolleyes:
Got that!!?
>Help me with suitable code...
We don't give away code.
Start by posting code you wrote to show us that you've put some effort in, and explain your problem more clearly.
I don't understand why you are printing text strings instead of hexadecimal representations of int or unsigned int values (see OP: where are strings there? ).
So the correct answer is: reread printf specifications and do as follows:
I was only giving a solution to outputting strings with a fixed number of characters, I did say "if the values are c-strings before you output them" to be fair :icon_rolleyes: and gave a better alternative method to do so.
Salem also made a good point in my reputation, I miss him actually being able to post :icon_rolleyes:
I don't use C very often, and very rarely use printf, but as he pointed out, you can do something like this instead:
#include <stdio.h>
int main() {
printf("%08s\n", "18");
printf("%08s\n", "3048");
printf("%08s\n", "ffff8007");
return 0;
}
Well depending on how you're outputting those values, this can be done in a few different ways. But if the values are c-strings before you output them, passing them to a simple function like this should work:
#include <stdio.h>
void fixed_print(char *text, int minChars, char fill) {
int i;
for (i = minChars - strlen( text ); i > 0; --i)
putchar( fill );
printf( text );
}
int main() {
fixed_print("18", 8, '0');
putchar('\n');
fixed_print("3048", 8, '0');
putchar('\n');
fixed_print("FFFF8007", 8, '0');
putchar('\n');
return 0;
}
00000018
00003048
FFFF8007
Hope this helps.
Okay ive had a bash at C++, but i have some errors (c++ pointers confuse me...)
...
Its supposed to be a linked list btw. The addNode and printList methods are what is broken.
Many of those errors are caused by things like illegal indirections and trying to assign values to members when there's no data allocated.
Remember that when you're trying to access members through a pointer, you have to use the -> operator, but that pointer has to have space allocated. For example, in this function:
void LinkedList::addNode(string data)
{
ListNode newNode(data);
head.setNext(*newNode); // if head is a pointer, then use the -> operator here
}
newNode is not a pointer, so you don't need the * there unless newNode is a valid pointer to a ListNode object.
It would take a while to go through the next 9 errors, so I recommend you revise pointers :icon_cheesygrin:
Hope that helps.
> Edit:: C++ Beginner's Guide is also a very nice one (you can get a free legal ebook copy here)
I bought that book before the age of 13, and was my first step to becoming the totally awesome programmer you see today :P