5,676 Posted Topics
Re: Are you supposed to use 6 different variables? If not, an array make the program easier. | |
Re: >I'm reading directly from the disk, so I guess I have to use ReadFile(); Why? What does `ReadFile()` do that any other read technique doesn't do? To alleviate your real problem, make your buffer larger than 512 -- say 16 more. Always read into the last 512 of that buffer, … | |
Re: 1st: Store the password in a file. Read it in for the compare. 2nd: For more security, encrypt the password somehow. Decrypt it before comparing. | |
Re: Yes, ASM can be very useful. If you need to rewrite a function because its too slow, ASM can make it quite a bit faster. If you need to interface with a module of some kind and C++ is too clumsy to do the interface, ASM to the rescue. Drivers … | |
Re: Store them in an array and when done output the array starting from the last input. | |
Re: That's assuming a selection structure means a switch statement. Since we don't know the context of your terms, it's hard to say with accuracy. | |
Re: The closest is a character array: char *name = "Jody"; // create a pointer pointing to the name of 5 chars char name2[] = "Mary"; // create an array of 5 chars to hold the name char name3[20]= "Janine"; // create an array of 20 chars to hold the name … | |
Re: > the thing I am confused is already been corrected but then I am stuck as I have no clue how to continue coding? And this is supposed to give us the information we need to help you? Think about actually asking a question we can answer. | |
Re: > for (i = srclen, j = 0; i < srclen && j < dstlen; i++, j++) If **i** starts as **srclen** when will `i < srclen` be true? What happens to your loop in this case? IMO, you need one more index value. Since you have **srclen** and **dstlen** … | |
Re: I don't see anything wrong with any *line 18*. When asking for help, you need to give details. What is the problem you see? You gave us a line, but is it the same line in the post? If not, use the numbers in the post. | |
Re: Can't read the code because of lack of [formatting](http://www.gidnetwork.com/b-38.html). Try again. | |
Re: First: Learn to [format](http://www.gidnetwork.com/b-38.html) your code consitently. It's difficult to follow. Second: [feof()](http://www.gidnetwork.com/b-58.html) is used incorrectly. Third: [system("pause")](http://www.gidnetwork.com/b-43.html) is not a good way to pause a program. Last: [scanf("%s",&text);](http://www.gidnetwork.com/b-62.html) is dangerous. `fgets()` is much safer. Since you didn't explain what you are trying to do beyond reading and writing the … | |
Re: >I looked up the format but it looks nothing like a bitmap... Why should it look like a bitmap? It's a PNG format. >... and I read the GDI doesn't support PNG's. So how does LibPNG do it then? By not using GDI I suppose. Since it's called *LibPNG*, it … | |
Re: Try [these](http://www.cplusplus.com/reference/iostream/manipulators/) for your formatting needs. | |
Re: >My guess is that codepad.org is breaking when it gets to cin >> input--it looks like the site doesn't do interactive input. >If you want to make it work there, replace any cin lines with string literals. You'll also probably run into problems with system("pause"). If the site doesn't do … | |
Re: >hey can anyone help me with the decrypt part...cant seem to get it to work.... Since you didn't bother to give us any information at all, all "I can say is figure out why it doesn't work and fix it..." Give us some details on what it does wrong and … | |
Re: > `#define FOR(i,a,b) for(int i=a;i<b;i++)` Why? What's wrong with just using the `for` statement? Making it a define simply makes the program confusing. | |
Re: When asking for help, **EXPLAIN** what problem you are having. Do **not** expect us to try to figure out what it does wrong -- tell us! | |
Re: When asking for help, **EXPLAIN** what problem you are having. Do **not** expect us to try to figure out what it does wrong -- tell us! And put **only** the code in CODE Tags -- not the entire post. | |
Re: When asking for help, **EXPLAIN** what problem you are having. Do **not** expect us to try to figure out what it does wrong -- tell us! | |
Re: When asking for help, **EXPLAIN** what problem you are having. Do **not** expect us to try to figure out what it does wrong -- tell us! | |
Re: Look up again how to use a character array as a **string**. You are missing a couple key pieces of information about a string's length and termination character. | |
Re: > Why is Dani Web so agitated when people ask a question? This person didnt understand something they came across and decided to post here to better understand it. Because based on the first post it is just another request to do his homework for him. He didn't ask for … | |
Re: > end_do_while Since there is no `do_while` a simple `end_do` would be clearer. ;-) | |
Re: > Also don't use #include <conio.h> and getch() because they are really really bad. Read *bad* as non-standard and prone to cause problems for you when you start using one of the 99% of the compilers that don't know what `<conio.h>` and `getch()` are. The standard definition of *bad* doesn't … | |
Re: Whould you care to give us some idea what is wrong? | |
Re: [QUOTE=vegaseat;]A Politically Correct Christmas Greeting: Best wishes for an environmentally conscious, socially responsible, low stress, non-addictive, gender neutral, winter solstice holiday, practiced within the most joyous traditions of the religious persuasion of your choice, but with respect for the religious persuasion of others who choose to practice their own religion … | |
Re: Problem #1: Never **ever** put code or variable definitions in a header file. Header files are used to *declare* functions and variables, not *define* them. Problem #2: void showList(const int list[], const int n) { cout<<"The list is ..... " <<endl; for (int i=0; i<n; i++) { cout<<setw(8)<<right<<list[i]; if ((i+1)%1000==0) … | |
Re: It's a *pointer* that points to a *pointer* that points to a *char* As for how it works, work it out. Draw a map of memory and see how it could possibly be layed out and used. | |
This is more of a rhetorical question, but... ... how is the article [Flame on: complex LUA and C++ cyber weapon fired at Israel, Iran and Syria](http://www.daniweb.com/software-development/news/424377/flame-on-complex-lua-and-c-cyber-weapon-fired-at-israel-iran-and-syria) related to [C: Access violation 0xC0000005:](http://www.daniweb.com/software-development/c/threads/427477/c-access-violation-0xc0000005#post1829060)??? | |
Re: 1) It's **crAsh**, not crUsh. 2) [See this](http://www.gidnetwork.com/b-57.html). Your use is undefined. 3) Be consistant in your formatting. [See this](http://www.gidnetwork.com/b-38.html) | |
Re: > My program thus far is not working out... Why is it no one likes to explain *what* the code does wrong and expects us to figure it out for ourselves? | |
Re: > Write the pseudocode to find the record with a specific studentID Well, do what the instructions say. If you have a list of numbers, how would **you** find a specific number? Assume each number is on 1 index card in a file box. Write down each step (the psuedocode) … | |
Re: Only [B]Ancient Dragon[/B] has the correct answer. You cannot ++ or -- the same variable in the same statement. The C Standard says doing so is undefined and not guaranteed to give the answer you expect. See [url=http://c-faq.com/expr/evalorder2.html]this[/url] and [url=http://c-faq.com/expr/ieqiplusplus.html]this[/url]. | |
Re: If you don't understand what you are writing, you should not be writing code. You need to sit at a desk with pencil and paper and plan -- yes plan -- what you need to accomplish. Write down what the task is. Break that description into pieces -- like in … | |
Re: [DO](https://www.google.com/search?q=definition%3A+do&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a) | |
Re: Add another [iCODE]getline()[/iCODE] just before the [I]return[/I] in main.... | |
Why can't I post a response without making it code? There is no code at all in a response I made and I cannot get it posted because I recieve the error: >If posting a code snippet, use the Code button in the editor toolbar >The code snippet in your … | |
Re: Code Snippets should not use anything in `conio.h`. They should be written so anyone can comple the program. | |
Re: >A much simpler way, if this concatenation is just part of a much bigger program, is to use atoi and itoa. itoa() the two numbers, then strcat(), then atoi() back. **atoi()** is simpler than (x1\*10) + x2? How do you figure that? Please explain... And [itoa()](http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/) is not generally available … | |
Re: To make your code more readable, look at how **pyTony** wrote the subscripte value. I'm all for using SPACEs, but too many also make code hard to read. | |
Re: >erm, whats wrong with my code? anyone can tell? erm, not if you don't tell us where the errors are... | |
Re: Look at string functions left$(), right$(), len() Use s FOR loop over the string read in. | |
Re: Not a clue what you don't understand. A MIN and MAX are quite obvious so without knowing what bugs you, we can't very well answer your non-question. | |
Re: [See this](http://www.gidnetwork.com/b-45.html) | |
Re: Ask for input Accept input Figure out what block the input signifies. | |
Re: Print your code. Sit at a desk with a pencil and the code. Write down the names of each variable in a column. Go through the code line by line changing the variable values as you go. Follow the loop until it exits. This is the easiest way to figure … | |
Re: >Hi everyone,I'm tryind to do something about sound on linux.I basically record some sound and try to encyrpt it using algorithm.However,I encountered some sort of pointer problem.Both RSA algorithm and recording&listenin sound works properly. - - - Basically,Rsa works with ascii array which includes char's of my word and encyrpt/decyrpt … |
The End.