|
arkiboys wrote: Apologiese, but I was trying to keep the question much simpler.
sorry.
That's garbage, you've been asking this question over and over again since 3 Sept.
You never answered this question[^] and now you are asking your original question, again.
led mike
|
|
|
|
|
Ok, sorry.
Thanks for your time.
|
|
|
|
|
What will I do to make this program go back at getnum/getID after the user inputs an invalid number? I mean like something that could return to the top after the Invalid Value statement. Please Help.
#include <stdio.h>
#include <conio.h>
int getID();
int main (void)
{
int getnum,y,x,w;
char c;
do{
getnum=getID();
y=getnum/10000;
w=getnum/1000;
x=w%y;
if(x != 0 || x != 1)
{
printf("INVALID VALUE!\nEnter new value: ");
}
else
{
printf("y = %d\n\nx = %d\n", y, x);
printf("do you want to continue, yes / no");
c = getch ();
}
}while (c =='y' || c=='Y');
getch();
return 0;
}
int getID()
{
int id;
printf("ID number: ");
scanf("%d", &id);
return id;
}
</conio.h></stdio.h>
bleh
modified on Monday, September 8, 2008 10:14 AM
|
|
|
|
|
Wrong forum. This is the C# forum, not C/C++.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
How is this C++/CLI ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
not CLI obviously, but the printf 's and #include 's with nothing after them (presumably angle bracketed and munched as html) strongly imply vanilla c/c++ to me.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Oh, it's vanilla C++, for sure.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: How is this C++/CLI ?
I didn't say that it was...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Apart from this being the wrong forum, we don't do homework for people on the forums - as you were told yesterday.
|
|
|
|
|
This is not my homework!
I'm writing a draft for my subject.
bleh
|
|
|
|
|
mistyangel wrote: I'm writing a draft for my subject
Does it make any difference?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
And how's that different to homework?
|
|
|
|
|
If you can't understand the difference between C ( this is C, not C++, right ? ) and C#, what hope do you have of passing your subject ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Put the input code in a do while loop with the validation being used to control the conditional.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Thank you for being so kind on answering it.
and thank you for nothing to the other people.
PS - I got it after like 3 hours of trial and error.
bleh
|
|
|
|
|
mistyangel wrote: and thank you for nothing to the other people.
See - the problem is, you're stupid. If we help every stupid person, when they post in stupid places, what would be the point of having different forums ? Why not just have one, if people can post whatever they like ? All you had to do was post in the right forum, and most people on this thread would have answered you.
It took you three hours to find a do while loop ? Is this like middle school programming class ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: See - the problem is, you're stupid.
Succinct. I like it
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
He learned that from me.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello all,
I have a problem printing a normal word-document. Ok the current situation looks like this: I have a server side application, which should print word documents which are on the server to a network printer. Eveything worked fine when i tested it but then i figured out that i had installed the printer on my server thats why it was no problem. But what if i dont want to install any printer on my server and i will get the printer name from the client? Its not working anymore after i removed the printer. But the funny thing is if i print any .txt file its working but not with a word. I always get the error 'There is insufficient memory' save document now.
but i have enough memory and or disk space.
can anybody help me please im getting crazy with this problem
here is my code:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = strFilePathSource;
startInfo.Verb = "printto";
startInfo.Arguments = strPrinterName;
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.UseShellExecute = true;
startInfo.ErrorDialog = true;
System.Diagnostics.Process.Start(startInfo);
|
|
|
|
|
Hard to say what the problem is but I would suspect that Word tries to ask something using a window. Since windowing is not allowed, it could result in insufficient memory errors when word tries to create the window.
But then again, this is purely a guess...
|
|
|
|
|
Hi Mika
Well thanks a alot for the fast reply. But its not that which is causing the problem that im sure, coz if i have the printer installed its working fine.
|
|
|
|
|
if I'm correctly understanding this snippet of code as using shell commands to do the printing, what happens when you enter the commands on the command line (or the start-run box). Also, assuming my assumption is correct, and it fails on the command line; a shell programming forum would be morel likely to be able to help.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Hi dan
Well ya maybe you are right with the forum, but i just tried it..
Back to my problem, i tried the code on my work laptop which is in the correct domain. And there it was working perfect. So my assumption is that i have to be in the correct domain for this code to work, i have tested the code in my IMAGE and there im not in the domain, so when i open word manually and want to print some word document to that partically printer which was also given in my codesnippet it wont work coz i cant find the printer. And like i said if its running on the laptop its working perfect. Could it be a domain problem? Im just a bit insecure coz the notepad file could be printed with no problems that why im struggling.
Ok well i hope i can solve this problem soon. Would like to hear some feedback abt the domain solution.
Thanks again for your fast reply
|
|
|
|
|
Good People,
I have a quick question.
I need some activities performed by a separate thread in my application. However, I need the main thread or another thread to be updated on progress and changes since that will affect the information they display and how they process some additional tasks. I need to know the best way to accomplish this task.
Any help or information you can provide would be greatly appreciated. I am a noob to threading and while I did get another thread to work, I couldn't get any updates in the main thread. So any help would be great.
Thanks in advance.
BP
|
|
|
|
|
Have alook at Manual Reset Event[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|