5,676 Posted Topics

Member Avatar for critznikkian

Create an 'input form' that looks like an InputBox. For every character hit, save it and replace it with '*' in the TextBox of the form.

Member Avatar for AndreRet
0
308
Member Avatar for lxXTaCoXxl

You need to look up how to translate [B]infix[/B] (normal a+b) notation into something like [B]reverse polish notation[/B] (ab+). RPN makes it easy to calculate an equation. But the translation into RPN is a little harder. Especially when parentheses are part of the equation. See [url]http://www.google.com/search?q=infix+to+reverse+polish[/url]

Member Avatar for pseudorandom21
0
282
Member Avatar for rjbrjb777

A couple things on your statement [CODE]while(fscanf(in,"%s %s %s\n,",&day,&mon,&year)>0)[/CODE] 1) you don't need the &. Each variable is already a pointer since they are arrays. 2) [B]>0[/B] is OK if only one of the values is needed. Use [B]=3[/B] if you want all values to be correctly entered.

Member Avatar for rjbrjb777
0
162
Member Avatar for FanionGolfer

Sound to me as if you either 1) haven't explained what you're trying to do properly (I'm lost) 2) haven't designed the concept well enough to start programming. Having a timer for SECONDs and another for MINUTEs shows you haven't thought through the task. Based on what I understand, you …

Member Avatar for WaltP
0
336
Member Avatar for geoffy0404

Agree. Also, [url=http://www.gidnetwork.com/b-57.html]see this about fflush()[/url]

Member Avatar for abhimanipal
0
220
Member Avatar for rohan_k

Well, yeah, why would you want to [ICODE]realloc()[/ICODE] one character at a time? Add 512 bytes at a time.

Member Avatar for abhimanipal
0
244
Member Avatar for programing

[QUOTE=VernonDozier;] Hence your "Big-O" time goes from about "n-squared", which is about what it is for Nichito's method, to "nlogn" for mine (basically the time it takes to do just the sort). [/QUOTE] But you're forgetting the 'time' it takes to do the sort itself. You need to add that …

Member Avatar for WaltP
0
2K
Member Avatar for ticktoc09

That completely depends on what the prof wants. He's the best one to ask. My gut feeling is no, just flowchart first, second, and last.

Member Avatar for WaltP
0
86
Member Avatar for ntrncx

After you get the ones digit, divide the number by 10. Now the tens digit is ready for the %.

Member Avatar for ntrncx
0
208
Member Avatar for az_ez

[QUOTE=mike_2000_17;]The bound that you use on the loop is not correct. "length" is the total number of characters in your memory buffer, it is not necessarily the number of characters that was read with fgets from the file. C-style strings are terminated by a null character. So, you should add …

Member Avatar for WaltP
0
135
Member Avatar for DaniwebOS

You'll have better luck with some explanation, not just posting code and asking us to figure out what it does. Pinpoint as close as you can [I]where[/I] the problem seems to be, and what the crash circumstances are. Basically, what you have here is the same as taking your car …

Member Avatar for jonsca
0
108
Member Avatar for highflyer8

Seems to me that you need to give us a specific code sample and explain what you are asking. Most of what you said is confusing and (I believe) wrong. But because it's confusing I'm not sure.

Member Avatar for Fbody
0
313
Member Avatar for Wheaties

[QUOTE=Wheaties;1501079]An array is any size, say 5000 indexes. If I input a 500 via some function, then my array will have 4500 null spaces hence forth and 500 valid spaces with which to plug numbers into later in the program. Is such a thing possible? [/QUOTE] Of course it is. …

Member Avatar for WaltP
0
228
Member Avatar for mpike

Can't follow the code with the lack of formatting. [url=http://www.gidnetwork.com/b-38.html]Please format it[/url] and repost.

Member Avatar for WaltP
0
168
Member Avatar for fraijyia

[QUOTE=satti;1500287]@Monarchmk u r right, i think we should leave him ...[/QUOTE] Not only that, but giving free code away is frowned upon. If they can't post their code, how can they understand your code?

Member Avatar for WaltP
0
2K
Member Avatar for FOGMAN

And why did you post this question in a thread from 3 years ago about a roulette wheel?

Member Avatar for Zvjezdan23
-3
107
Member Avatar for shinsengumi

[CODE] start = 10; // start writing at byte #11 bytewritten = fwrite(&buf[start],1,payload-start,fp);[/CODE] [iCODE]&buf[start][/iCODE] is the address of the 11th byte

Member Avatar for shinsengumi
0
219
Member Avatar for Khoanyneosr

Is there something about the sticky post at the top of the forum titled [url=http://www.daniweb.com/software-development/cpp/threads/90228][B][I]Read me:[/I] How do I flush the input stream?[/B][/url] that you don't understand?

Member Avatar for Khoanyneosr
0
132
Member Avatar for Zvjezdan23
Member Avatar for WaltP
0
184
Member Avatar for alexa868

Your loop states [iCODE]while (notas[x]>100 && notas[x]<0);}[/iCODE]. Can this ever be true? Read your condition very carefully with [I]notas[x][/I] qual to -10, 50, and 110. Write out a truth table to see what happens.

Member Avatar for WaltP
0
99
Member Avatar for efronefron

[QUOTE=efronefron;1499171]In my system, which is ubuntu, fflush doesnt do anything. Ive tried using fflush(stdin) and it doesnt really flush anything, the characters in stdin are still there. fflush doesnt do anything in my system,its just like another empty line.[/quote] That's because the standard states [ICODE]fflush()[/ICODE] is only required to work …

Member Avatar for efronefron
0
287
Member Avatar for anu07
Member Avatar for caut_baia

[QUOTE=Fbody;1499097]Posting code isn't the problem. It's the situation and type of code posted. [URL="http://www.daniweb.com/forums/announcement8-2.html"]Read this.[/URL][/QUOTE] Yes, as [B]cscgal[/B] says: [QUOTE=cscgal]Though we are all here to help, please don't expect quick solutions to your homework. We'll help you get started, exchange algorithm ideas, how-to's, etc. but only if you show that …

Member Avatar for caut_baia
0
372
Member Avatar for SeePlusPlus2

1) It isn't, really. Reference param passes the address into the function rather than the value. 2) Yes 3) [b]new[/b] doesn't store anything. It defines space and puts the address of that space in the variable specified. Consider variables as boxes you store stuff in. Each box can hold a …

Member Avatar for SeePlusPlus2
0
232
Member Avatar for ntrncx

All you need to know about rand can be found [url=http://www.google.com/search?q=c%2B%2B+rand]here[/url]. '3' is a character, "3" is a string. [I]cout[/I] simply outputs what it is given, so in the example you mention, there is no real difference. They are essentially identical.

Member Avatar for ntrncx
0
130
Member Avatar for visom

Error #1- You didn't use CODE Tags Error #2- You didn't bother to tell us what the error you're talking about is. This isn't the [I]Psychic Homework Help Desk[/I].

Member Avatar for visom
0
3K
Member Avatar for ywong89

You really want us to look through 650 lines of code to 1) find you compare function? 2) figure out what's wrong? Sorry, nope. Pinpoint the problem areas and we can see what we can find.

Member Avatar for ywong89
0
5K
Member Avatar for Khoanyneosr

Problem #1: [ICODE]switch(inst[50])[/ICODE] -- this command only checks the value at [I]inst[50][/I], which is the byte one past the end of the array [I]inst[/I]. What are you trying to test here? Problem #2: [ICODE]case 1:[/ICODE] -- You entered characters, not integers, and this [I]case[/I] is an integer value. [quote=Khoanyneosr] Is …

Member Avatar for pseudorandom21
0
1K
Member Avatar for PerplexedWon

To avoid this problem in the future, compile often. Write the basic code framework first (includes, main(), return) and compile. Write a class and compile. Make sure it compiles clean. Write the next class and compile. Write a function and compile. Keep adding and compiling, fixing any errors immediately as …

Member Avatar for PerplexedWon
0
172
Member Avatar for blee93

Each character has a numeric value 'A' = 65 'B' = 66 '0' = 48 '1' = 49 and so on. Subtracting '0' subtracts 48, so [Icode]'2' - '0' = 2[/Icode], equivalent to [iCODE]50 - 48 = 2[/iCODE] Now look at the code you posted. Does that shed any light …

Member Avatar for frogboy77
0
209
Member Avatar for faizlo

The code you posted cannot display the output posted. The simple solution is use a FOR loop.

Member Avatar for winrycool1
0
167
Member Avatar for sreekiranws

[QUOTE=sreekiranws;]Hello I need some help as to the limitations or flexibility of header files. I have written a code that updates a base folder when it is compared to its newer version. I have hit on a roadblock though. If a new file is added to the folder, the program …

Member Avatar for WaltP
0
215
Member Avatar for jayzee1989

Where did you learn that [iCODE]if(menuinput == (l || L))[/iCODE] is a valid IF statement? You need to look up how a compound statement is written. And what's the purpose of assigning [iCODE]l = 'l';[/iCODE] and [iCODE]L = 'L';[/iCODE] just to use variables in the IF statement? Use the characters …

Member Avatar for WaltP
0
137
Member Avatar for harikrishna439

Change your browser's font to one that uses different characters for the letters.

Member Avatar for WaltP
0
73
Member Avatar for aqnie

[QUOTE=aqnie;1494612]hey I am new in C++ and I have finished my code but my Prof. asked me to write pseudocode and I have no idea what that is and I dont know how to write it.[/QUOTE] Well, in my opinion, you should have ask him this when he told you …

Member Avatar for aqnie
0
120
Member Avatar for DoubleH

Back to probability. You need to use [iCODE]srand()[/iCODE] and [iCODE]rand()[/iCODE] to get your probability. Get a random number between 0 and 99. If the number is 30 or more the record is OK. If < 30, reject it.

Member Avatar for NathanOliver
0
184
Member Avatar for Dani

Now clicking on the thread icons no longer goes to the unread posts. Even after ^R.

Member Avatar for ~s.o.s~
0
214
Member Avatar for jephthah

If [I]source2.c[/I] doesn't need anything in [I]library1.h, library2.h, another.h, etc.h[/I], why include them? As [B]L7Sqr[/B] said, it's just noise. The compiler is doing work for no gain.

Member Avatar for Ancient Dragon
0
486
Member Avatar for bleedsgreen33

Read the entire line. Check the characters looking for a letter. That's the beginning of the name and the end of the account number. Next check looking for a digit. That's the beginning of the address and the end of the name. Etc...

Member Avatar for Ancient Dragon
0
364
Member Avatar for shinsengumi
Member Avatar for Zvjezdan23

Would you mind explaining how you 'save' numbers? It's so much faster than trying to understand 452 lines of code.

Member Avatar for stav141
0
147
Member Avatar for eltonpiko

First thing you need to do is understand both languages well and understand the grammatical rules for each language then be able to tell what translates to what from what I see in your post you do not understand english well enough to tackle a program like this you need …

Member Avatar for jon.kiparsky
0
1K
Member Avatar for xiaoberry

Follow your post as if it were a map of your program. You've got it all there and in an order you can use.

Member Avatar for WaltP
0
200
Member Avatar for beejay321

Let's start with these two functions first: [QUOTE=beejay321;]• int lastDig(int num); This function returns the last digit of num.[/quote] If you pass in the value [B]100101101[/B] this function will return [B]1[/B]. You can do this using the modulus ([B]%[/B]) operator. [QUOTE=beejay321;]• int removeLast(int num); This function returns a number without …

Member Avatar for WaltP
0
440
Member Avatar for thekitoper

Or if stringstream is too advanced, [iCODE]atoi(argv[i])[/iCODE] will also suffice. [B]i[/B] will be an index into the [B]argv[/B] array.

Member Avatar for thekitoper
0
127
Member Avatar for TigrisAltaica

No error message, just crashes? Nothing to give you an indication why? That's really strange. Try to pinpoint what statement causes the problem.

Member Avatar for TigrisAltaica
0
154
Member Avatar for rjbrjb777

Depending on your O/S, look up the system's [I]Execute[/I] functions. There should be one that allows you to execute Program 1 and wait until it exits. Other option is to run Program 1 and just before it exits, start program 2 with [iCODE]system()[/iCODE]

Member Avatar for WaltP
0
113
Member Avatar for fka

Put the [iCODE]srand()[/iCODE] functionn call back in [iCODE]main()[/iCODE]. And where's the header that define the random functions?

Member Avatar for mrnutty
0
205
Member Avatar for chess2009

[QUOTE=chess2009;]Hi When you ask for a person to write what code he/she has written and then ask questions based on his/her code other people can simply copy and paste his code.[/QUOTE] That is true... [QUOTE=chess2009;]That is called COPYRIGHT.[/QUOTE] No, that is not copyright. Copyright is a legal status of intellectual …

Member Avatar for Ezzaral
0
367
Member Avatar for makibao

1) Please [url=http://www.gidnetwork.com/b-38.html]format your code[/url] so we can read it properly. 2) Do not use [iCODE]gets()[/iCODE], [url=http://www.gidnetwork.com/b-56.html]here's why[/url]. 3) [iCODE]main()[/iCODE] is not a [I]void[/I] function. [url=http://www.gidnetwork.com/b-66.html]See this[/url]. 4) To get help, you need to show an attempt. There is no attempt in this code for 4 & 5.

Member Avatar for makibao
0
149

The End.