I will pray for you.
hey pray for me too.
i got a whole list of stuff i'd like to get by June.
thanks
I will pray for you.
hey pray for me too.
i got a whole list of stuff i'd like to get by June.
thanks
use the additive property:
(a * m) + (a * n) = a * (m + n)
example:
result = (a << 2) + (a << 4);
// result now contains the sum, 4a + 16a = 20a
cout << a << " times 20 = " << result << endl;
.
I am confused. First you say you want to write the program. Then you say you want somebody to send the code for such a program to you.
those were two different people.
but as to that second guy, welcome to Daniweb. it's pretty much the reason why the long-term users here are often cynical and jaded towards noobs.
Or do you know the 'ultimate' way?
i know the ultimate way
#include<jephthah.h>
newStr_ptr = removeSpacesAndCondense(myString);
it's non-standard and not very portable, but hey, it works on my machine.
We are not here to argue...
We are here, as a member, to help those who have
problems...
speak for yourself.
i'm here for the smackdown.
what's this non-standard conio.h and clrscr() crap?
why do you refuse to use code tags?
i dont know if your program works in any meaningful way, because it won't even compile
get this weak stuff out of here.
suppose there were another planet similar to earth in composition, temperature, and atmosphere.
(and given the bazillions of stars in the universe, the probability is quite high that, somewhere, there must be)
so, considering another earth-like planet with H2O, carbon, and oxygen... over a couple billion years ... what kind of life would evolve? why wouldn't it make sense that many of the life forms that would result, would be similiar to life forms that either once existed on earth in the past, or currently exist on earth today?
you know, mammal-like creatures like cows or mastadons. or reptile-like creatures like dinosaurs or crocodiles. or at least, your basic fish variants and plant life.
and the things that were different, they wouldn't necessarily be radically different from creatures that could conceivably be found on earth. like a pig-dog. or a lizard-bird. or something.
just a thought.
either a sloppy abbreviation for "numbers" (abbr. "no.")
or he's looking for the LCM and GCF of two noses.
on further review, i prefer the latter.
it just.
doesn't.
stop.
or if you use FF and ABP, you dont ever have to worry about any site ads, anywhere, ever.
maybe its a problem with ESL but i dont know WTF the OP is saying.
humanity will be reduced to scavaging and cannibalism. roving bands of blood cults will enslave others as catamites. women will be subjected to birthing babies as a food source.
PROBLEM:
noobs are continually posting mountains of unhighlighted code, and its just nearly impossible to read such messes without highlighting... i dont even want to try, it hurts my head.
making this worse is the people who need the most help are the same people who are the worst offenders. often times, their errors are something simple syntax or typo error, and could easily be spotted if we could just read it.
It's bad enough getting them to use [code] tags in the first place. But I cant keep bitching at new guys or gals because they dont know to use specific syntax highlighting.
SOLUTION:
by default, unspecificed [code] tags will *always* use the syntax highlighting for whatever the particular forum happens to be. this will be backwards compatible, because all specific code syntax will continue work as normal. if there's not already an option, allow something like to just be plain vanilla text.
[B][U]EXAMPLE[/U][/B]
for the C code forum,
[noparse][code][/noparse] prints C-syntax highlighting [code=c] prints C-syntax highlighting [code=php] prints PHP highlighting [code=plain] prints plain text (no highlighting)
whereas for the PHP forum
[noparse][code][/noparse] prints PHP-syntax highlighting [code=c] prints C-syntax highlighting [code=php] prints PHP highlighting [code=plain] prints plain text (no highlighting)
et cetera...
.[code=plain] to just be plain vanilla text.
EXAMPLE
for the C code forum,
[code] prints C-syntax highlighting
prints C-syntax highlighting [code=php] prints PHP highlighting [code=plain] prints plain text (no highlighting)
any int variable is inherently an *integer* the value is not stored in any particular base .... hex or decimal or binary, it doesnt matter. the only difference is when you print it. printf("hex value %04X = decimal value %d\n",Dec, Dec);
but also, what youre asking to do is to concatenate an upper byte to a lower byte. or you could also say you're adding a left-shifted value to another value.
you could do it like this: Dec = (TH1 << 8) + TL1;
.
I can't call the function multiple times bc in destroys my maze after one go I'm was trying to think of how to do it without compromising my maze.
all you have to do is store the original maze in memory and recall it each time with the new person's position.
you've been handed 90% of the solution and 99% of the difficulty. all you need to do now is construct a for or while loop to implement it several times.
why would you ever want to enable safe search? internet without noodz? maaaaan, that's about as fun as a box of ... er as fun as .... well look, that's just not any fun.
were you always picked to be hall monitor in school?
seemingly random
there's your problem: nothing is truly random. some things are just less predictable than others.
the fact is, you're never goign to generate truly random numbers, even if something like that existed. so be happy with the commercially available pseudo-random number generators, like the rest of the world.
if you're doing something that needs more than that, then you're working for the NSA and shouldnt be trolling Daniweb for your answers.
tell me what is the entire point of the book?
tell me, what is the entire point of this thread?
besides being a means for some random internet guy to air out his creepy obsession for a female user, while simultaneously demonstrating that he doesn't know anything about programming.
because anyone that would either (a) take the 20-year-old Unix Hater's Handbook as being some sort of serious critique in favor of Windows, or (b) use it as evidence that C++ is a "horrible language" .... that person is a gotdam fool.
i figured how 2 solve q4 now but i tried 2 solve 1,2,3 i cant do anything .
bull crap.
you did not just spontaneously "figure out" how to write the code for Q4, and yet still remain completely helpless to even begin Q1 - Q3. because Q4 combines all the elements of programming that you would need to know for Q1 - Q3
what happened is, someone gave you the answer for Q4, or you found it on another site, and now you're still waiting for someone here to give you the rest of the answers.
until you show some of your work so far -- and ask a meaningful question -- you're just going to be ignored.
.
wait, what?
its been three days ... why haven't you guys finished helping this kid write his spyware program, yet?
who do i give neg rep to?
well, then maybe one of you Win32 API gurus can post something remotely resembling an answer to the OP's question??
W00T!!!!1
i got my star!!!!
now i can finally go to bed.
:P
const
means the program can not modify the value volatile
means the value may be arbitrarily modified outside the program.
the two are separate and not mutually exclusive.
use them together, for instance, in the case of reading a hardware status register. const
prevents the value from being stomped on, while volatile
tells the compiler that this value can be changed at any time external to the program.
this const volatile <type> <variablename>
will thus satisfy both requirements and prevent an optimizing compiler from incorrectly optimizing the code, that it would do if only "const" were used.
... someone else's account?
there's some new guy who signed up last week, using a Calvin avatar.
i want him taken out.
hi everyone.. i have to build a satellite navigation and control system in any language.. i have no clues on how to begin this.. can anyone plz send me an algorithm on controlling liquid propellant boosters using neural networks?? thanks
on further review, I believe I have falsely accused Trav580 of being the culprit.
i see now, that multiple posts have been copied, not just TRAV's, and that they all the posts seem to appear on the other site, about 30-60 minutes after they are posted on here.
TRAV580, I'm sorry for jumping to accuse you.
some of the surface details seemed coincidental, but now I see that you were just bringing this to Daniweb's attention.
ahah. he doesn't know C at all and barely knows C++, and yet he just performed the impossible -- with proof! call the ACM journals! prepare the honorary PhDs!
seriously though, where DO these people come from?
oh, are those questions?
or demands?
or merely the instructor's notes to the students on how to fill in the framework of this assignment that was provided to them?
do you have a reading/comprehension disability or something? i'm not saying your code is wrong. i have no idea if its wrong or right because I cant read the garbled formatting that includes 3 lines of junk for every line of code.
and have neither the time nor inclination to reformat your convoluted mess.. if you cant be coherent, then dont bother
i'm sorry, what the hell do i what?
i don't know, i was just reading what you wrote.
You probably don't need lots of IR sensors.
ahh. i feel better already :)
you know how some threads seem like a good idea late at night
... then later on in the light of day, they just seem kind of fail?
do ya?
or are you just smiling and nodding?
It doesn't seem like a topic of opinion though
well, apparently this one is.
hey, that reminds me, which is better: big endian or little endian? i seem to have forgotten...
as omnivores, humans are adapted to eating both meat and vegetables. our digestive track has enzymes evolved specifically for breaking down animal fat and protiens.
that said, we don't have to eat meat. so if you don't, good for you. but without a doubt it is more difficult and expensive to maintain a healthy diet that is lacking in animal protein.
in short, to each their own. if you don't want to eat animal meat, then don't. but I do, so if you don't like that.... too bad.
hmm. i thought my post was calm and to the point. the inappropriate use of and reliance on globals is a habit that is reinforced by laziness and/or a 'get-r-dun' attitude.
i understand your position: you think that at this point it's not worth the time to undo what he's already done. presumably, he'll learn to not learn globals some future point.
but what i'm saying is that I think it IS worth the time, right now -- otherwise, the time never gets taken. and the habit steadily becomes more firmly entrenched.
i'm just expressing my opinion based on my experience. i wasnt attacking you; don't take everything so personal.
.
And you can write a termios.h solution that will be broken on every non-POSIX system. What's your point?
that my indignant self-righteousness only flows in one direction: from GNU/GPL and against MSFT.
it ain't right, but i can still sleep most nights.
sorry, folks, i didn't mean to come off sounding like such a dick.
truth is: i still have issues, and i'm exceedingly frustrated by this subject
especially by the paradoxical fact that i live in the most technologically-advanced country, which seems to be always on the verge of being taken over by a bunch of superstitions chicken bone shakers.
it probably didnt help that i grew up and spent a large part of my adult life in the U.S. South. or that I've got a bunch of fundamentalist anti-intellectuals in my family.
:(
yeah, i know.... this account came free with a lvl 70 orc mage i bought on EBay.
:(
my point is that STRSTR function will do what the OP wants
i thought it would be readily apparent to anyone who takes a moment to look it up. sorry, if i don't type out a fully commented and validated solution.
Essentially the solution is this:
get one line at a time with FGETS, then use STRSTR to see if a certain string (such as the particular "id_no") is found within the line. if not, then read the next line. if it is, well, there's your line.
i'll leave typing out the code as an exercise for the reader.
i see nothing much has changed since ive been gone.
This isn't the place for "can you tell me about some feature of C". This is *not* a lecture hall, and we don't have the time to be unpaid tutors.
You have to remember, there are a *lot* of students who post here.
Post your code, and tell us your problem with it - we'll try to help. That's what we do, and that's about all that we have the time to do.
I'm sure you can google just about any subject or question to find tutorial material on the features of C.
damn, dude. lighten up already. this place isnt for you to vent your frustrations on some hapless student for asking legitimate questions. Yeah, perhaps he framed his question a little oddly (it did seem like he wanted code) but there is nothing wrong with asking questions on how C functions work.
because that's the purpose of this place: for students (and professionals) to ask C programming questions. Now if you dont have time to answer these questions, that's your business. don't answer them, okay?
but maybe you should spend more than a month here before you decide who this place is and isn't for.
.
When you declare a "char" array as
char *abc="alpha"
, the string is not editable i.e. readonly, You need to declare it aschar abc[]="alpha";
, if you wish to edit by using theabc[index]='';
method,Why this difference exists however I am not aware of !!
well, y'see... hmmm... okay, i guess i don't really know WTF you're talking about
because to declare an array of chars as either char * myString
or a char myString[]
is the same effect. in either case, "myString" is a pointer to the address containing the first character of that array of chars.
.
I'd suggest to you that STRTOK might not be the best choice here. because the delimiters in STRTOK are treated equally. STRTOK takes a string and divides it up into any number of equivalent "tokens" based on the blind application of one or more "delimiters" that are used to mark the boundaries of the tokens.
For your problem, you want to differentiate between opening bracket < and closing bracket >, so you can treat the text found within the brackets differently than the text found without.
So I would instead use a couple of char * pointers to keep track of relative positions within the search string, in conjunction with STRSTR to find the next bracket location, along with a variable that keeps track of whether you are "inside" a tag (because the last bracket found was '<') or "outside" a tag (because the last bracket found was '>')
.
i wish threads that have had no activity for 90 days or more, would be automatically locked.
lets stare deeply into each others eyes for long moonlit walks on the beach!
MM PJM ND NS HWP ISO BI or G C or LDS BBW LD LS OK DDF a plus GSOH and SI for FTA send photo YMMV RTFM PEBCAK OMG LOL TTYL
.
im kind of a moderate, so i guess i dress down the center.