5,676 Posted Topics

Member Avatar for triumphost

255 is -1 in 8 bits. 65535 is -1 in 16 bits. Your 255 in the G section is getting promoted to an integer Instead, try shifting then ANDing to get the correct bits, using the 32 bit cast: inline RGB Rgb(int R, int G, int B) {RGB Result = …

Member Avatar for WaltP
0
354
Member Avatar for campuzcrazyness

[QUOTE=ssharish2005;657378]There no any reason on why do we have to convert it binary to hex. At at least i havn;t come across any application which need a that feature![/QUOTE] I have.

Member Avatar for bmsangati
-1
1K
Member Avatar for bgraw

>i have the whole right code for this program We don't do homework for people here. This is not a cheat site.

Member Avatar for bakabozza
0
218
Member Avatar for Perry31

> the value stays the same 1010 1011 if i use char or unsigned char. even if i use 171 or -85 does not matter, how is it ? The 8 bits used to represent -85 and 171 in binary are identical. For a signed value, the first '1' is …

Member Avatar for WaltP
0
261
Member Avatar for existinglady

That's what tutorials, books, and teachers are for. We are not a teaching site. Yes, I know it's simple, but you try to do it, and we can help you fix it.

Member Avatar for Lucaci Andrew
0
415
Member Avatar for atown282

Problem is your are using `system(pause)` to pause your run. You are waiting at the OS at that point, not your program. C++ has input functions, like `cin`, `getline()`, etc that waits better than `system(pause)`. Use them instead. There is no reason to call the OS to pause any program. …

Member Avatar for Lucaci Andrew
1
578
Member Avatar for Dudearoo

**Vernon Dozier** said > Indent your code. It's impossible to read. You've ignored him. If you are going to ignore the help you have already been given why should we help you further?

Member Avatar for rubberman
0
160
Member Avatar for poloblue

> I have problems in this section of the program Are your problems a secret? Or would you care to enlighten us? We aren't psychic... I've noticed most of your initial posts are a comlete waste of your *and* our time since all you do is post code and ask …

Member Avatar for m4ster_r0shi
-1
140
Member Avatar for sameerge

Even before the pervious question is answered question 2 is nonsensical. C++ could be written in ForTran or Cobol if the creators desired.

Member Avatar for WaltP
0
219
Member Avatar for new_developer

> I think END keyword will finsih the line and bring the next output in the next line so avoid the keyword. Not quite. **endl** will. Alternate is to use **ends** to avoid the *newline*

Member Avatar for new_developer
0
1K
Member Avatar for poloblue

Do you have a question? A problem? If so, you might want to explain...

Member Avatar for Schol-R-LEA
0
402
Member Avatar for Albino

> 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(43): warning C4715: 'load\_image' : not all control paths return a value The function `load_image` has returns that do not return a value. > 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(43): warning C4715: 'load\_image' : not all control paths return a value The function `load_image` has returns …

Member Avatar for Albino
0
470
Member Avatar for KalebG

Generate a random number from 0 thru 16777215 (hex FFFFFF) and load the background color property.

Member Avatar for mustaffa hasan
0
2K
Member Avatar for tomtetlaw

> I have a for loop like this: > for (i = 0; i < max; i++) { ... } > > But when I run it, i is being set to max > > If I set i to 0 in the first line of the for loop, it …

Member Avatar for DeanMSands3
0
150
Member Avatar for tubzz

>......???? ......!!!! Reread **deceptikon**'s first sentence in the previous post. Answer *that* question.

Member Avatar for deceptikon
0
674
Member Avatar for tubzz

Don't need arrays. Set *total* to zero Read a number if not -999 Add it to *total* else print *total* And [format](http://www.gidnetwork.com/b-38.html) your code.

Member Avatar for tubzz
0
192
Member Avatar for sunfutbol

While \v is something I've never used, I have used \f. On output it will *generally* form feed, kicking out the page when encountered. It's the code that is used when you do a page break in your word processor.

Member Avatar for WaltP
0
179
Member Avatar for paranoidSandra
Member Avatar for paranoidSandra
0
121
Member Avatar for trishtren
Member Avatar for WaltP
0
389
Member Avatar for gali01
Member Avatar for jaskij

>Another disagreement was with braces - where to put them? Since I scan the code more like it is for script languages (like Python), that is ignoring braces and looking only at indentation, I went for the more compact style of putting the opening brace on the same line as …

Member Avatar for two[ ][ ]
0
176
Member Avatar for rhoit

You never defined **tmpstr** except as a pointer. There is no storage space associated. Therefore `strcpy(tmpstr,tekst);` copies into never-never-land, and therefore blows up.

Member Avatar for rhoit
0
369
Member Avatar for trishtren

Why do people always need to `seek` to get the length of a file? In this case, you want to read the header, right? How big is the header? Just create an `unsigned char` or `byte` array to read in a chunk of the file -- 512, 1024, 2048 bytes... …

Member Avatar for WaltP
0
168
Member Avatar for tuputavieja

Almost enough details for understanding.... Do you have a function defined to read a line and do something with all the other data yet? Let's see how many more questions we need to ask.

Member Avatar for Sokurenko
0
121
Member Avatar for Dasttann777

> with no luck, Meaning what? Compiler error? Outputs wrong stuff? crashes the computer? Creates a black hole that sucks in the known universe? What exactly is `isalnum(str firstin)` trying to do? What's **str**? > how do I make it so that it only operates if the first input is …

Member Avatar for m4ster_r0shi
0
169
Member Avatar for reyesg

Each character has a numeric value. 'A'=65, 'B'=66, 'a'=97, etc. There are 256 possible values. So read a character. Use the character as an index into `stAlphabet[256]` and increment that value. When you hit the EOF, you will have the count of *all* characters in the file.

Member Avatar for WaltP
0
109
Member Avatar for awesomeriley

> I am getting a crazy number of errors that i honestly do not know what is wrong. I am getting a syntax errot before the "int"s in the switch, and conflicting types of all the function names. Any help will be appreciated. Then reread the section in your book …

Member Avatar for deceptikon
0
183
Member Avatar for robgeek

> My problem is when I compile each file separately I get the error: 'Undefined reference to ReadFromfFile()" (Note: ReadFromFile is a function defined in definition.c and I get this error when I compile the main.c file) Your compile is also linking, and definition.c was not specified. > And when …

Member Avatar for WaltP
0
355
Member Avatar for mrexp21

> Finally, a lot of the younger members are probably unfamiliar with flowcharts; they are generally considered obsolete, Really? When did this happen? What superseded it -- at least from a student standpoint?

Member Avatar for Schol-R-LEA
0
233
Member Avatar for SandraD

>But I really want to learn about it in c++, because I would like to improve myself in that language :) Why is it people always want to "*improve myself*" doing things that the language makes it difficult to do and can only be done in rare cases in the …

Member Avatar for WaltP
0
113
Member Avatar for Dasttann777

Suggestion #1: Do your compares case-insensitive so that **binary**, **Binary**, **BINARY**, and **bInArY** use one single compare. Suggestion #2: Put all the questions (and answers) in a file. Have the questions sorted alphabetically and read them into arrays. Then look up how to do a **binary search**. That will make …

Member Avatar for m4ster_r0shi
0
161
Member Avatar for WaltP

When I use **bold** followed immediately by *italic*, the WYSIWYG box shows the post properly. When posted it does not. **Bold***Italic* The above shows properly before posting.

Member Avatar for WaltP
0
140
Member Avatar for whileiforelse

>Does this mean I have to create a new project everytime I want to run a single program? Yes. If you made chili in a pot yesterday, would you want to make tomato soup today in the same pot with the leftover chili? You either 1) clean out your pot …

Member Avatar for whileiforelse
0
116
Member Avatar for Onlineshade

> I can not find the problem of this code....... After 300 post one would think you'd know how to ask questions by now. Always **explain** why you think there is a problem. If you don't tell us why you think there's a problem (error messages, bad output, whatever) how …

Member Avatar for mustaffa hasan
0
156
Member Avatar for arushi.05

I do... If you want help, you have to provide the work, we can provide direction and suggestions.

Member Avatar for Despairy
0
122
Member Avatar for Gaiety
Member Avatar for lewashby

Close. he functions returns a value from 0 to **n-1**. > `hits[r]++;` `hits` is an array. Increment the **r** *th* element of `hits` > `cout<< static_cast<double>(hits[i]) / (n / 10)` Break it into it's pieces based on the parens and you'll see. Or be more specific in what you don't …

Member Avatar for WaltP
0
77
Member Avatar for Sendy Hipo

> is the problem because of the compiler? No. You have `C++ Strings` and you have `C-strings`. Both are different and **not** interchangable. Some functions have been designed to use C++ strings; some use C-strings. The documentation of each function tells you which one you need to use. Some compilers …

Member Avatar for Sendy Hipo
0
154
Member Avatar for wan632

> What part of "small, complete program that exhibits the problem" was unclear? Considering "*Hye i am running difftime tu different 2 time values*" my guess would be all of it... ;o)

Member Avatar for WaltP
0
713
Member Avatar for wan632
Member Avatar for wan632
0
115
Member Avatar for Sendy Hipo

Test each value entered. Make sure something was typed in. Are string.lengths greater than 0? Are numbers not 0?

Member Avatar for Sendy Hipo
0
420
Member Avatar for Gaiety

Since the context of your second statement is unknown, and, as it stands, is false, I think you are confusing two different problems thinking they are the same.

Member Avatar for mike_2000_17
0
128
Member Avatar for Dani

> If you accidentally hover over, you have to wait for the fade effect to go way. I would find this **exceptionally** annoying. Every site that has those green underlines piss me off every time I move the mouse...

Member Avatar for Sahil89
0
844
Member Avatar for stephanieirene

>This is homework Really? What makes you think so? You waited 1-1/2 years to make your first post with this newsworthy information???

Member Avatar for Lucaci Andrew
0
345
Member Avatar for koolzed

1) Turn the computer off. 2) Sit at a desk with pen and paper 3) Write down the functions you need to create (add, delete, search, ...) 4) Take each one at a time and write the steps needed to accomplish them -- in **great detail** 5) Run through the …

Member Avatar for WaltP
0
1K
Member Avatar for SalicBlu3

Why not just create **array** as a large array? Say `int array[1000]`? The concept of increasing the array size by one for each and every value entered is so resource heavy that I don't really think a useful solution.

Member Avatar for m4ster_r0shi
0
133
Member Avatar for aznairjordan

`char sentence[100000];` How many words do you know are 100000 characters long? Wouldn't a shorter 'sentence' be better? And if you only want words, would a variable named **word** be less confusing than **sentence**? ;o) Also, `while(!inf.eof())` -- [see this](http://www.gidnetwork.com/b-58.html)

Member Avatar for Sky Diploma
0
212
Member Avatar for yavindu

Turbo for Windows 7 64 bit doesn't exist... The last version of Turbo was created in the early 1990's

Member Avatar for WaltP
0
82
Member Avatar for timberwolf94

>I have been looking at my loop structure and functions for a while now but cant seem to find the problem. I need another set of eyes to look it oveer and see if they can't point out the problem to me. More than likely it is just a simple …

Member Avatar for TrustyTony
0
349
Member Avatar for altec64

Since you need to keep track of a whopping 8 moves, a stack seems to be overkill. Just add each move to an array.

Member Avatar for mrnutty
0
1K

The End.