WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I see that the square, in this case, is a 9 x 9 square, and that each descending number appears as a multiple of 8 (There are 8 4's, 16 3's, 24 2's, and 32 1's), but i'm not sure of any other patterns.

You're kidding.....

Line 1: 111111111 all 1's
Line 2: 122222221 1's and 2's
Line 5: 123454321 12345....

I really do like programming, it's just that the problem solving part is difficult for me.

As Tumlee implies, you had better get good at it. It's one definition of programming.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Dman01's suggestion only works on a select few compilers, therefore is not a good solution.

You need to read the input as a string of characters, test the characters to make sure they all all of the correct type, then either
1) show an error
2) convert to integer

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Can anyone please explain me about callback functions with examples?

Maybe this can help

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Why does it matter?

And if it does, ask the developers of 7zip. They are the ones that designed the program.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

As Narue said 2.5 years ago... :icon_rolleyes:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I know the MEMBER RULES you read mentioned CODE Tags. USE THEM!

And when someone asks you for format your code, format your code!

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Try formating the code and start using braces "{}"

And post problems you are having. Don't make us guess.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

this are my coding ..what missing is delete function and loading function from menu ..i try to do it , but could not get a solution ,

No you didn't. There is no delete function in the code at all. And for 'loading', what's readfile() do?

... and the loading part is where u loading data from different txt file ...

U? What's a U? That is not a word.
Input a file name from the user and open it instead of data.txt.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

my guess keep your guess for your self , and if u find it on any web come and make your guess

OK, here you go! There's my guess!

Gotcha!

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Where is proxy() defined?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

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 as well as those who choose not to practice a religion at all.

I resent that! :icon_twisted:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Why did you write it in c++ if the requirement was to write it in C?

My guess is he found the code on the web and didn't write a line of it...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

1) Write functions that do one thing and one thing only. In your case:
-- 1 function to calculate and return the perimeter.
-- 1 function to calculate and return the area.
2) main() should contain a loop that
-- reads a single triangle
-- calculates the perimeter (by calling your function)
-- calculates the area
-- outputs the data

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

If you don't believe us, then write the program and remove all doubts.

The easiest way to alleviate doubts is to try it and see what happens.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Problem #1:
After your first scanf() , the ENTER you typed is still in the input buffer, waiting for the next input. Your second scanf() reads that ENTER. So the value is not 'y' nor 'n', so no message.

Problem #2:
And, as zeroliken said, the variables Y and N have no value. You want characters, not variables.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Well OP, Your code do have a problem, see while using "Do while" loop you should increment the value of the integer inside the loop

So currently the value for (x) is never getting incremented. Thus the value never reaches 4, so it becomes infinite loop.

Not true. What does cin >> x; do to x immediately after the do ?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

i must be going out of bounds for the array text.

In your first code, why are you using new to get temp then you delete ret?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Sorry, I'm not reading code that isn't formatted. See this.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I don't see any problem other than poorly formatted code. See this -- proper formatting usually helps find errors.
Also, in case #3 you should add a break. If you add more CASEs and forget, you've got another error.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yes

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

in the 2nd code, the int i is not defined in the main(), so, because of that, we can use multiple 'for loops' with same iterator(int i)?

Why can't you use i in multiple FOR loops if i is defined in main() ?

unlike 'while loops', the int i declared in the main(), so we can't do the same as the 'for loops'?

What can't you do the same? What's preventing you from using i in the WHILE loop and FOR loop?

can anyone confirm of what I "discover"? :)

I'm unclear what you 'discover'? Unless I misunderstand you most of what you're saying is wrong.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Why are you decrementing then incrementing the loop counter in the FOR loop? You should not touch the loop counter...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The answer to the poll is terrible! How are we supposed to respond to "how was the question?"
Tasty? Needs salt? Entertaining?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hello.
The title pretty much says it all.

Don't use the title as part of your problem description. The title is only to evoke enough interest for us to click on the thread. Then it's forgotten...

I would like to know if and how you can print a number (type is double) with the same amount of decimal spaces as the one you entered.

Read the number as a string. Count the decimals. Convert the string to your double.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Seriously? True, the iterative version of factorial is O(1) in memory, whereas recursive factorial is O(n) in memory.

I'm soooo sorry. Let me rephrase:
"2 lines fewer... (3 if you formatted better)
And not a wasting O(n) memory as well as n calls and returns.
"
Better? :-P

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Raisefamous you should see function and recursive implementation.
Look how easy is recursive implementation :

double factorial (int n)
{ if(n==0)
		return 1;
    else
        return n*factorial(n-1);
}

Look how easy a nonrecursive solution is:

for (int i = 2, i <= number; i++)  // loop through all of the numbers
    {
        factorial *= i;
    }

2 lines fewer...
And not a memory hog.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

u r new to this site i think. u are not here to give us homework for us. do urself!!

And you must be new to this site too, otherwise you would know that leet speak is not to be used here. Makes you sound like a child, very unprofessional.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

How do you redo the program to find numbers in the line (starting with -+0123456789) and insert the word NUMBER before these numbers (in the results file).

Find each word
Test the first character
If -/+/digit then output the word NUMBER
Output the word
Repeat.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You need a second variable to keep track of the i value when you find the highest.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Read a word fin >> word; Increment counter numwords++;

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

As an example, here's a function that you pass in the name of a text box and highlight the contents.

Public Function selectTextBox(Ctl As Control)
    Ctl.SelStart = 0
    Ctl.SelLength = Len(Ctl)

End Function

That should give you an idea how to pass in your combo box name.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

If you use a FOR loop from 1 to N, this loop would control each line.
Then inside that FOR loop you have more loops that control the pattern of each line.

Your job is to figure out how to create the line pattern. What is the same in each line? What's different? Find the one pattern that defines each line.

Hint: 3 loops...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

And if you can't use iomanip.h you can certainly use printf() . It's still part of C++.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

What's wrong with the standard form:

int change (int k)
{
    if (k==1) k=0;
        else  k=1;
    return k;
}
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

[boilerplate_help_info]

Posting requests for help must be well thought out if you want help quickly and correctly.  Your post did not meet the criteria for quality help. You may get some posts, but are they going to be useful?  Check your post with these checkpoints - what is it [i]you[/i] missed:
[list=1]
[*]Ask a question that can be answered. Do not ask
- What's wrong with my code?
- Why doesn't this work?
- Anything else that does not give us useful information.
[*]Post your code.  If we don't know what you did, how can we possibly help?
- Use [b]PROPER FORMATTING[/b] -- see this
- Use CODE Tags so your formatting is preserved.
If we can't follow your code, it's difficult to help. We don't care that you're still working on it. If you want us to read it, it must be readable
[*]Explain what the code is supposed to do.  If we don't know where the target is, how can we help you hit it?
[*]Explain what actually happened! If we don't know where the arrow went when you shot it, how can we tell what went wrong and how far from the target you are?
[*]If you have errors, post them! We can't see your screen.  We can't read your mind. You need to tell us what happened.
[*]Do [b]not[/b] ask for code. We are not a coding service. We will help you fix your code. 
    If anyone posts working code for you, they are a …
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Look at your loop definition. Look at the code. Compare variables.

Also, if you add num[i], num2[i], and carry, you get a value from 0 to 3. Look at your IFs to see if you do different things when you get 2. Or 1. etc. If you don't do different things, you probably don't need so many comparisons.

I'll bet you can compress that whole section (48-109) into less than 10 lines with a little thought.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hi,

Yes, Client_ID's should be Unique.
But still if, you want to renumber them, Change your code to :

Public Sub generateid()
    Dim i As Integer
    i = 1
    If rs.State = 1 Then rs.Close
    rs.Open "clientdetails", admincon, adOpenDynamic, adLockOptimistic
    Do While Not rs.EOF
       rs("Client_ID") = i
       rs.Update
       i = i + 1
       rs.MoveNext
    Loop 
End Sub

Regards
Veena

But what about all the other database records in the other tables that have the ID in them?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Looks like it.
Do you have to do anything with line 6?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Instead of using fgets() , use a FOR loop to read num numbers using scanf("%d"...) .

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

can you show to us in the code itself what you are trying to say sir?

Everything I mentioned is self-explanitory. I don't need to show you in the code because the code already is wrong, and if you change the code as I explained, it will be right.

I mean, I don't understand what's wrong with using void main() we've been using it with our other programs and its never been a problem...please help, thank you very much!

That's what the link is for. To explain so I don't have to. Read it.

Just because it works for you on your compiler doesn't make it correct. Running a red light can be done, too. But eventually you'll get caught. Then you can tell the officer "but nothing bad happened all the other times I ran the light". That is if you're not dead...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Sounds to me like a reference is a pointer with hidden code to make it look like a variable. The function has to get either
1) the value of the variable, which is local or
2) the address of the variable, which is a reference.

No need to continue this here. I'll look up the inner workings -- unless Narue chimes in. I like the way she explains things...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

For the love of god, why can't you just format the friggin' code properly? It's not that hard! And why are you the only one that requires us to create data files, create projects, and run code just to understand what you should be able to explain in 3 lines of text?

We've got 900,000 other members that want our help and they follow the Member Rules when asked. What's so special about you? Why are you above the Rules?

You're right. I will stop posting in this thread. And since I'm the only one that has, good luck...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Preferably references. Pointers are a waste of processor when you can use references instead.

Serious question: What's the difference...

I though reference was just the C++ term for pointer, like folder is the Winblows term for directory.

And if they are different, how are pointers a waste of processor?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

system("cls") is cheap and easy. just like my women.

Easy, yes. Cheap, no. The 'work' needed to call the operating system, find and execute the pause command, then exit the O/S and return to the program is more like a $1000 call girl. It works well, but is far from cheap.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

and the post number, too.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Don't understand the question.

Try an example.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

mdiParent.cmdPrint.disable -- specify the form.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hi, guys I am working on vb project, which will save client database.

I've done the coding of ADD, NEW, SAVE, EDIT button. Now, I am stuck at DELETE button. When I delete any particular client then I want my client_id (it's a column in my access database) should get updated (like if I have five clients in database and if I delete 3rd client, then the client_id should start from 1,2,3,4; not like 1,2,4,5)

No it shouldn't. Once assigned, a client ID should never be changed. It is their unique value used throughout the system. All records pertaining to that person should be using this number and not their name, so the change would be monumental in a 'real' database.

What do you think would happen in the real world if, when someone stops driving, all the driver's license numbers changed?

Netcode commented: lol +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Start at the main function and read the code a line at a time. When it calls a function, read through that function.

What's not to understand about the procedure?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Any suggestions will be much appreciated /Any trolling will be much abused :)

And I'm wondering, as a moderator, just what kind of abuse you are thinking about? Remember the Member Rules. You can get banned by abusing others here... :icon_wink: