5,676 Posted Topics
Re: [url=http://www.gidnetwork.com/b-56.html]See this[/url]. You do not want to use [iCODE]gets()[/iCODE]. It's dangerous. And your [I]s2[/I] definition is OK since you have it defined at 30. [B]Dragon[/B] misread your code. And [ICODE]strlen()[/ICODE] returns the length of a properly formatted string. | |
Re: #1) Forget the game board. Just work on input of the guess and output of the result. Isn't that the important part of the game? #2) I don't see a class defined anywhere. That's probably why you can't get it correct. My suggestion: [B]a)[/B] Write the class and code to … | |
Re: Please find someone to help you translate your question into English. The translation program you are using creates unintelligible giberish. | |
Re: You can't use 'normal numbers' like [I]int[/I]s or [I]long[/I]s. You need to come up with a system that allows you to compute 1 number at a time. Using arrays for each number where each array element holds 1 digit of the numbers might work for you. | |
Re: Of course. Read the string from the user. Use the string as the filename. No magic about it. Let me change your question and the answer to this is how you wold do the filename thing, too: [QUOTE=penguino138;]Hi. I was wondering if there was a way to have the user … | |
Re: [CODE]Start xLow at 50 start count at 0 while xLow not 90 add 1 to count increment xLow [/CODE] Is this really that hard? | |
Re: You need to look up the format of the IF statement. Not one of them is even close to being correct. | |
Re: I have a novel idea -- talk to your teacher? I remember them helping me when I was in school. | |
Re: Does your [I]getData()[/I] function work? If it doesn't, you don't need to work on the print function yet. When programming, take it a step at a time. | |
Re: So do it. There are many compilers to choose from. | |
Re: Write it up and post it here. If it makes sense, Dani can move it where it will do the most good. | |
Re: [QUOTE=madmhan84;]...but I have one problem[/quote] No, you have many problems. 1) Using bold, underline, red text, lines of hyphens to make your post look cute. It's unnecessary and distracting. By the way, you forgot to use [I]italics[/I]. 2) Your formatting is bad -- [url=http://www.gidnetwork.com/b-38.html]see this[/url] 3) [iCODE]void main()[/icode] -- [I]main()[/I] … | |
Re: [QUOTE=pepperhead11;1550247]Ok, I've been trying to run this program on Borland C++ (Version 5.0A). The program is a Point of Sale program. I keep getting the errors "expression syntax at (121,26)" and "If statement missing ) at (129,6). Try as I might, I can't seem to fix the errors. [/QUOTE] I … | |
Re: Look up and learn the file/directory commands that your compiler or OS use. An example would be something like the functions [I]findfirst()[/I] and [I]findnext()[/I] available in some compilers. | |
Re: I wouldn't "read" the second IF either if I designed it that way. Assuming your files will always be in sorted order as you posted them: [CODE] Read from file in1 Read from file in2 loop until EOF cmp = compare in1-line with in2-line if < read in1 again else … | |
Re: [url=http://lmgtfy.com/?q=snake+game+code]Here[/url]. Stop being so lazy. | |
Re: [QUOTE=joru819;]So I made some changes and got everything operational but the logic is wacked out. It seems like when I get bust to work draw doeskin. Not just these logical evaluations but the whole series that states the outcome of the game. I have never had so much trouble with … | |
Re: Another rule of thumb: Add to you code [iCODE]cout << "ptr-> " << struct->member << "\ndot. " << struct.member << '\n';[/iCODE] Which one outputs correctly? That's the one to use. And figure out why. In no time you'll understand it. | |
Re: [QUOTE=gruffy321;]i just have to ask, ...would you consider being taught about files and records in Pascal a good way of learning about files records (or i think they are called structs or typedefs in C) for use in C. I dont think so......... but would love to know an opinion … | |
Re: Google: [url]http://rabbit.eng.miami.edu/info/functions/time.html#gtod[/url] | |
Re: Unless I completely misinterpret you, no, you are making sense. What doesn't make sense is creating a file for each person. If you have 1000 people in your contact list, you're going to have 1000 files. This will make your program slow and use a lot of system (disk) resources. … | |
Re: Without proper [url=http://www.gidnetwork.com/b-38.html]formatting,[/url] your code is extremely difficult to read. Repost with good indentation. | |
Re: To make the program better, put the 'work' in a loop. That way you only need one % and /. When the number is 0 the loop is finished. | |
Re: [QUOTE=youLostTheGame;] that's the code he gave me but i don't know how to apply it to my code. (will post below) [/QUOTE] So what's that code do? That the first thing to understand if you want to use it. | |
Re: What if there are 2 or more spaces between some words? Did you count the first word? It has no space in front of it. Did you consider the way many people now incorrectly write? They never add a space after a sentence -- just run the 2 sentences together. … | |
Re: [QUOTE=yongj;]How can I make it from here so that it can list only the directory list that matches a specified file name pattern. So for example, how can I code it so that if I type myDir *.c it would list all files with an extension ".c" in that current … | |
Re: [QUOTE=aprilchica3;] I think my problem lies in the capital function(). Only the first line capitalizes. I have gotten it t work in using cout, but it doesn't update the saved file. I am confused in using the ifstream & ofstream in the same file at the same time so maybe … | |
Re: What are you doing with [iCODE]let_number = tolower(letter[i][j]) - 'a';[/iCODE]? Now, based on your description "it isn't reading correctly", do you think that's enough of a description for us to understand the problem? Please always give details so we can understand the problem. And where is the seg fault happening? … | |
Re: Probably differently than you did in your program. But since you didn't post any code, we can't tell what you did wrong. | |
Re: Create the class Open the file Read a line Place it in the variable continue. Pretty basic stuff. | |
Re: You waited a whole 15 minutes? Come on, guy, some of us have lives and don't live on the board! As to your question, change the [B]deal[/B] function to return 1 and only 1 card. Then you can created a [B]dealHands[/B] function that will deal as many cards as you … | |
Re: [QUOTE=cse.avinash;]yes a=0 is required in that for loop, since the loop has to be executed only once. I need help in reducing the code to 65 bytes, or if there is any other code. Please help me.[/QUOTE] Please stop begging. Posting to ask for help does not need a "[I]help … | |
Re: [QUOTE=jimJohnson;]I apologize that did not come out how it should have[/QUOTE] Is this supposed to mean something? My guess is your second command line parameter for the write file is bad. And it doesn't already exist since you are using the OPEN_EXISTING flag. | |
Re: By reading the words on the background of the box you typed your post in. And all over the place CODE Tags are explained. | |
Re: [QUOTE=CoilFyzx;1543303]You see certain syntactical expressions have a [B]higher level of precedence than others[/B] By this I mean certain codes are "more important and so are executed first...for example ++ has a higher level of precedence that just + and brackets,namely () have an even higher order of precedence than ++ … | |
Re: Both are new... I'm sure an announcement is coming. | |
Re: Are you using pencil and paper to "run" your program and see what happens? It's only 4 lines of code. Certainly you can follow that much just to see what the code does. | |
Re: Check your braces carefully -- top to bottom. | |
| |
Re: [QUOTE=bonzo2008;1542430]Hi just wonder how I can use commandbutton ( caption Letter A) click event to read names from an random file that just corespond to letter A in to an listbox.[/QUOTE] In the click event 1) open the file 2) Start a loop, exit loop on EOF 3) Read a … | |
Re: Neither do we. If it won't compile, it probably has errors. If it has errors, the compiler tells you what they are and where. Since we are not compilers, we need details. | |
![]() | Re: You need to think about what you are doing and look carefully at the variables you are using. Are they the correct variables for each line? ![]() |
Re: Every time you enter any input, do you press the ENTER key? That key does go into the input buffer, ready for the next input. You need to clear it out. | |
Re: Get a random number modulus 2 to get a bit. | |
Re: Read the Member Rules and find out. You were asked to do so when you registered. | |
Re: No, don't convert to decimal. It's not necessary, and it's harder. You can convert directly into hex. Finish defining your [iCODE]char hexadecimal[17][/iCODE] array (and it only needs 16 values). Then start at the end of your binary and convert 4 'bits' into an integer. Use that integer to get the … | |
Re: Each compiler is written specifically for the OS it runs on. The [I]compiled[/I] program therefore runs only on the OS it was built on. [B]Standard C/C++[/B] relates to the source code. All compilers should accept any C/C++ code that was written to the C/C++ Standard and output a working program. … | |
Re: Pass the midpoints in by reference. Load your values into them. They will be changed when you ret |
The End.