What did the open file return?
My guess is the program is running in the compiler directory, not the source directory.
Open and write "text.txt" and find out where the file was created.
What did the open file return?
My guess is the program is running in the compiler directory, not the source directory.
Open and write "text.txt" and find out where the file was created.
Programming language:
I've used assembler, Fortran, Basic, and C. Choose a language you know and can connect to the software driver you need to interface with the hardware.
Operating system:
Anything the software driver will work on.
Hardware:
Usually you need a computer interface that converts the computer signal onto an electrical signal in some manner. Many times that comes in the form of a hardware board added to the computer the converts a binary value into electrical currents.
Many times the device you want to control is computer ready. You plug the cable in, send a value, the device works.
The hardest part is deciding what value to use and where to send it -- usually explained in the manual.
Use the second one. The first one is crap.
for (a = 0; a <= ID[50]; a++)
There is no ID[50]. ID[] goes from 0-49 (50 entries). And you have no data in ID[50] to begin with for the comparison.
You want to:
Open the file
Set [B]a[/B] to 0
Start a [B]while[/B] loop
(you don't really know when the loop is supposed to end -
it depends on how many values in the file)
Read the [B]ID[a][/B]
Read the [B]GRADE[a][/B]
add 1 to [B]a[/B]
end loop
Close the file
I'll let you figure out how to exit the loop.
Yes
It's because your Illiterate and make silly comments anyway Wenbnet.
Who's illiterate? Literate people know the difference between your and you're.
just recently, since i couldnt get atol(); to work, i actually went and changed atol(const char*); to atol(char); in the stdlib.h file. the program ran but after i entered my equation, the program crashed.
How did you change the atol() code in the run-time library to match your change? Or did you only change the declaration in the header? Think about it...
I recently couldn't get around the lake easily to get to the east side of town, so I changed the city map to have a bridge. But I almost drowned when I took the bridge. What went wrong... :icon_rolleyes:
Even though AD explained the problem, I have to add to it:
hey, this is supposed to collect data into a 2 by 3 array. believe it or not, my teacher wrote this problem and he spent 20 minutes trying to figure out why it wasn't running properly. anyone care to help me figure out what was wrong with it??
Given that explanation, what are we supposed to be looking for? "...why it wasn't running properly" means what? What is unproper about it? What are we looking for?
"...what was wrong with it??" depend on what it's doing.
When you need help, please explain what we're looking for, why you claim it's not working. It really saves us from guessing.
Well I assumed X (being a 'char') is any letter.
No, it's any value 0 to 255. But which one? If you don't set it, you have no idea.
Ok, so the solution to this would be...
} while (isalpha(integervalue));
Right?
Am I making any sense? :P
That looks like it would work. Did it?
Also: if(integervalue>-9999999999999)
What?!?!?!!
Maybe reading the information on the site that created the library might help.
Convert your PHP code into C++ code. Compile the program. No need for anything but the database and C++ program then.
My most recurring problem is clicking on the UP/DOWN arrows and have nothing happen. Finally after multiple clicks, the box usually opens. But not always.
Look at the string character by character.
I don`t use allegro timers because I don“t know how to use them.
Can you teach me how to use them?
Oh, absolutely! Here you go. Anything else? We're here to serve.
Read a string fgets()
set flag to TRUE
For i=0 to string length
if string(i) != digit nor dot set flag to FALSE
end for
if flag = FALSE number was not entered
hope i wasnt to late thought :P
Only by SIX years... :icon_rolleyes:
Of course there is. cin
will accept all data types in one statement.
Maybe you need to explain in detail what you are trying to accomplish in the end. Based on your question as posted, it's a trivial procedure. Just look at one character at a time and combine them into separate strings based on operator/digits.
Meaning what? You want to
1) write a program that accepts voice commands and executes stuff?
2) write c programs by voice using a voice program that already exists?
And please don't command us to "please reply" -- we will reply if we have something to say without being ordered...
Never Never load a value into argv[]
variables! Never! You will probably crash the program by overwriting memory you don't want written. And if it doesn't crash, you have no idea what will happen to your program. Like maybe a file not found.
At least with GNU GCC, there is not need to reinvent the wheel, they are declare (very logically) in math.h: http://www.gnu.org/s/hello/manual/libc/Rounding-Functions.html. As that is standard header they could be even part of standard:
http://en.wikipedia.org/wiki/Math.h
Sure. And when you need to actually know how to do it because your next language doesn't have math.h, what do you do? People should not be relying on library functions for this easy stuff as a new student. They need to understand the underlying concepts first.
AFAIK, there is no way of doing this. You can of course use a pen and paper (or a text file in computer savvy terms) to keep track of things but I'm sure you didn't have this in mind when you asked the question. ;-)
Pen and paper? Text file? We need a full blown database each of us can download! Hooked directly into DW servers...
At least now I know what S.O.S means -- Silly Ol' Suggestions! :D
I want to be on top in the fraction.
Use CODE Tags when posting code.
It's your thread. Mark it solved.
Add 0.05 before the truncation.
system("command >NUL");
sorry, i dont want to sound anal, but could you be a little more specific? its telling me the file cannot be found.
You don't know what a full path is?
And to fix your code
system("copy .\\subdir\\abc.txt abc.txt"); /*copy to program directory from subdirectory?*/
system("copy .\\subdir\\abc.txt .\\subdir2\\abc.txt"); /*copy from subdirectory to subdirectory?*/
*mumbles something about bugtracking systems..
Bugtracking is only as good as the users using it.... :icon_wink:
I prefer something along the lines of
char s[] = "here Is A String With White \n Space";
int i1, i2;
...
i2=0;
for (i1=0; i1 < strlen(s); i1++)
{
if (!isspace(s[i1])
s[i2++] = s[i1];
}
Another version:
string s = "here Is A String With White \n Space";
string t = "";
unsigned int i1;
cout << s;
for (i1=0; i1 < s.length(); i1++)
{
if (!isspace(s[i1]))
t += s[i1];
}
s = t;
cout << "\n\n" << s;
To me it's more straightforward and easier to read.
I'd like to be able to read your code. Please post a clean version of it. Here are some guidelines to help.
In general:read a line
check if one of your keywords is present
if so, parse the data out
go back to read another line
Er, don't you guys think this thread has starting to turn into a debate?
Of course we do. Why do you ask? :icon_wink:
I'm not being harsh. I'm not advocating doing anything about it. I'm just saying people should take pride in their communication and if you are a native speaker of any language, use the language as properly as possible. IMO homophones are so easy to understand they should become a no-brainer. There's enough harder stuff going on in a language, especially English, that we pretty much need to turn a blind eye to. But lazyness is just lazyness.
Please point out anywhere in any of my posts I suggested/requested/considered:
... a person with a poor grasp of written English be barred from public spaces, like DW?
Native English speaker: anybody can live anywhere (almost). Immigrants often change their names. I really can't see how your crystal ball works.
Knowledge, age, time on forums, years of communication. Someday you'll get there. :icon_wink:
Are you sure that Indians are taught incorrect words? That's quite a supposition. Possibly, individuals using doubt and question as interchangeable have probably used Google translate or a dictionary to find the nearest word to their native one.
Search this site for the word doubt. If the rest of the post looks like a Google translation, I'll give you the point. You will see they don't use translation. And check the location of the people that use doubt. If it's only from 1 country (India) it's clear that they are being taught the wrong word. I doubt everyone that uses the wrong word is using the same dictionary. There are just too many people making the same mistake to be coincidence.
The words, in fact, are interchangeable in some circumstances, perhaps not syntactically, but they can convey the same meaning. OK, I'll stop being pedantic.
Maybe in some circumstances. "I question/doubt your expertise", "This is a questionable/doubtful solution" come to mind.
Can you justify the use of doubt in these posts?
i ve a doubt in sql.. want to display all dates between 2 dates..
I have a doubt regarding a function myfunc(int i,int j) function. The return value of this function is
i have one doubt in c# database connection
I have a doubt regarding the InputStream.read(byte[] b) function.
etc.
Check the location of the poster...
I just don't understand how you can detect if a poster is a native English speaker or ā¦
Does it bake cookies or cakes?
1) English as First Language posters that have no clue what English words mean.
2) people that teach English that don't know what words to teach.
You misunderstood my points...
This is too simplistic. English is not my first language, but I bet the standard of my language (English) is better than a few born and bred in England. It doesn't mean I need to look down my nose at them. Likewise, I am fully aware that my grammar can be a little suspect at time, as I generally think in one language and put the pattern to work in English. It sometimes makes me sound as if I come from Sheep City. Not everybody gets the same breaks in life or the same life experiences. This can have a bearing on one's vocabulary and ways of expressing oneself.
My point here is if you are a native English speaker and went through normal school, you should know the difference between there/their/they're and not misuse them constantly. If you are not, like you, a native English speaker, you would be expected to mix them up. I commend those that aren't native speakers who have a better grasp of English than us natives.
With regard to the second point, 'people that teach don't know which words to teach'. Unless students study a Modern Foreign Language at post-high school level, I doubt very much whether they could be termed 'fluent'. In addition, 'use it or lose it' applies. I ā¦
1) Make sure the file is in sorted order
2) Read the file into an array of strings
(not a 2D-char array as suggested)
3) Use a Binary Search (google it) to find whatever the user enters.
Is this thread one of those that is going to be resurrected once a year forever more?
Yep.
Wanna bet? :icon_wink:
Just test the end of the string for 0x0A and replace it with 0x00. Then test again for 0x0D and replace with 0x00.
Unfortunately, this doesn't seem to work. I've tried this and various other combinations and I'm still stumped.
Then you probably did it wrong. Can't help if we can't see what you tried.
You don't. If you've never used it, why must it be deleted? Just let it stagnate.
Not being harsh. I'm simply talking about
1) English as First Language posters that have no clue what English words mean.
2) people that teach English that don't know what words to teach.
All others I give the benefit of the doubt -- unless they have no concept of punctuation at all and type 5 sentences at 1 or no SPACEs after . & ,
Them I don't like either. I'm certain their language has sentences.
Use full paths. It reduces ambiguity and errors.
Set up a flag (OuputBlank) initialized to TRUE.
When you output a blank line, set flag to FALSE.
Next time you need to output a blank line, test the flag first.
When you output a non-blank line, set the flag to TRUE.
== nevermind ==
I have written the following program.
It collects inventory information and stores it in a file.
I need to write a separate program that will access that file and give me the totals of the information stored in it ie. (quantity,wholesalecost,retailcost). What I'm specifically having trouble with is how to read out the information in file and store it in to a local variable?
I don't understand. You obviously know the format of the file and how it is written -- you created it. You know how to write the file in the proper format. Just reverse the write and make it a read.
By definition everything you read goes into a local variable.
Just for the record: We're not the grammar-police here. If you mix up a "your" with a "you're", you won't get banned. We understand that a lot of our members do not have English as their primary language and that some (other) people might be dyslectic.
Oh how I'd love to, though. If they live in an English-speaking country they should not have passed rudimentary English if they don't know the difference between
they're/their/there
than/then
its/it's (well, I'll give them that one)
etc.
I'd like to downvote them but even that feels harsh.
And of course, the omnipresent doubt! Who teaches English in India?
Or the browser BACK button? Or opening the link in a new TAB?
Simply calculating recursively distance from pacman to every square is more than enough. Only problem is that this is too tough, you must 'stupidify' the ghosts logic, say they can not 'smell' the pacman from too far.
I wouldn't do anything recursively in this program. Since the goal is to stay away from the ghosts, you'll eat up all your memory recursively trying to get them to Pacman.
Each time through your process loop, calculate the direction to Pacman and move in that general direction. If there's a decision point, randomly choose the direction toward him.