6,741 Posted Topics

Member Avatar for ronicasingh

It's possible to draw, and read images, but you're limited basically to the ASCII art category of drawings.

Member Avatar for Narue
0
68
Member Avatar for oneguy

Why don't you profile them both and get more specific performance metrics? I'd guess (without looking closely at either program) that the difference is in caching.

Member Avatar for Narue
0
61
Member Avatar for lemichelle

>// Here I want to delete the character, I'm not sure how to do that... Deleting a character essentially means overwriting it by shifting every character after it left by one cell: [code] abcdefg efg abcd efg abcd abcefg [/code] A loop to do this is relatively simple: [code=c] size_t …

Member Avatar for Aia
0
78
Member Avatar for question!!

>I want to know if VC++ provides getter and setter >for each of these properties(like textbox,radiobutton) ? No, but it's trivial to write them yourself. You can also force generated controls to be public, but that's not a good practice.

Member Avatar for question!!
0
115
Member Avatar for TheBeast32

>save values to a file on program exit and read on program start Coupled with encryption and a good tampering check, I'd prefer this one. >save values in the registry Which adds a whole new layer of complexity to your application. Best to avoid the registry. >save values in the …

Member Avatar for TheBeast32
0
142
Member Avatar for White-Gandalf

>I could not answer the question why the compiler >was not saying anything to this construct. Compilers are only [I]required[/I] to notify you about constraint violations. Further errors, and warnings in particular, are specific to the compiler and are there only because they make a compiler more user-friendly and thus, …

Member Avatar for Narue
0
266
Member Avatar for leverin4

>dep(1,1,2000); >ret(1,1,2000); This is assuming that your Date class overloads the function call operator and allows three arguments. I'm guessing you don't have that particular overload, in which case what you were trying to do (initialize dep and ret to new instances of the Date class using a three parameter …

Member Avatar for Narue
0
111
Member Avatar for Ryano24

There's nothing stopping your code from compiling as C++. If you really want to make it look more like C++, just replace scanf and printf with cin and cout. That's pretty much all you can do, as the program is extremely simple and doesn't use language specific features beyond I/O.

Member Avatar for Narue
0
128
Member Avatar for Nemoticchigga

>How do I access 'whatever'? You don't. That's the whole point of making it private. Only the class itself and friends of the class can access private members. You can allow access but still control it by offering a public interface: [code=cplusplus] class Foo { public: int blah; void set_whatever …

Member Avatar for White-Gandalf
0
80
Member Avatar for Narue

Here's a challenge for you C++ aces. The challenge is to write a function with the following declaration: [code] unsigned long extract_digits ( unsigned long x, size_t n, size_t i ); [/code] This challenge has three parts. [B]Part I (Beginner):[/B] Write the extract_digits function. It should return a sub-value of …

Member Avatar for ivailosp
1
680
Member Avatar for mengmarc

>1. what syntax should i use to insert character that allows 'space'? cin.getline: [code=cplusplus] cin.getline ( emp->name, 50 ); [/code] >2. is there a syntax that can 'search' name within a list,,, what is it? It's called a loop: [code=cplusplus] node *it = strtPtr; while ( it != 0 ) …

Member Avatar for mengmarc
0
122
Member Avatar for alkeshtech

I see where you're trying to go with it, so I guess it does make sense. Why do you ask?

Member Avatar for alkeshtech
0
105
Member Avatar for gwarguy

>I need to figure out what i want to program, and then use the right language for the job. When you're first learning you need to just pick a language and go with it. You can't use the right language for the job if you don't have experience with the …

Member Avatar for majestic0110
0
203
Member Avatar for bhaltulpule

First you need to decide if you want to use parameters to move s around, or access it globally. Right now you're mixing the two together and as a result you have way too many variables named s. This uses parameters rather than the global variable: [code=c] #include <stdio.h> void …

Member Avatar for Narue
0
238
Member Avatar for alsoumhi

>it is like this ( int main ( int a , int b , char* c) ) Then it's wrong. The main function only supports these two definitions: [code=c] int main ( void ) { /* ... */ } [/code] [code=c] int main ( int argc, char *argv[] ) { …

Member Avatar for Narue
0
287
Member Avatar for rem0404

>if you find errors in the isFull and addMessage functions please let me know. I'll focus on those two, but be aware that there are problems in the rest of your code. >if(!isFull) You forgot that isFull is a function. It needs an argument list. >messages[numElements]+=message; >keys[numElements]+=key; Most likely you …

Member Avatar for rem0404
0
72
Member Avatar for betaven75

>Now I would like to know about file handling. What exactly are you trying to do? >Also, could you let me know if there is any good material >(online) on the topic of LINKED LIST (Single & Double). I think [url=http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx]this[/url] is good, but I'm a little biased. >Do treat …

Member Avatar for Narue
0
91
Member Avatar for lookforlohith

>warning: the `gets' function is dangerous and should not be used. It's pretty self-explanatory, I think. gets is dangerous and shouldn't be used. So stop using it. :icon_rolleyes: May I suggest cin.getline as a replacement for gets? It's somewhat of a bad practice to mix the C style I/O functions …

Member Avatar for Narue
0
133
Member Avatar for acidburns

>Why is that ? It's easiest to understand if you have a perfect binary tree (all levels are full). Notice that each branch contains twice the number of nodes. This means that in a perfect binary tree, the number of nodes on each level is exactly the number of nodes …

Member Avatar for Narue
0
103
Member Avatar for mar000m

>share your ideas......what do you think....... I think you're not going to get anyone to tell you how to do this. It's your assignment after all. Start by figuring out how to read an expression from the input stream. You need to be able to build an integer from multiple …

Member Avatar for mar000m
0
264
Member Avatar for soosai

>Randomly generate a number within a certain ASCII >range then display the corresponding character. First, that's not a portable solution. Second, it's not an elegant solution either because you end up screwing around with multiple ranges and basically playing number games. A much better solution is to store all of …

Member Avatar for echocoder
0
100
Member Avatar for lookforlohith

The compiler doesn't know where to look for total, so it looks for local variables and then global variables. If you want to access the static member, you have to qualify it with the class it's declared in: [code=cplusplus] item::total += a.itemprice; [/code] Alternatively you can use the object to …

Member Avatar for lookforlohith
0
646
Member Avatar for gehad3003

>i want to ask why we use an underscore here in ch=_getch(); Because that's how the compiler defines it, probably.

Member Avatar for Narue
0
130
Member Avatar for electromania

All you need to do is keep a count of rows and a running sum of the values. You pretty much had it: [code=c] while (fgets(buf, 80, stocks) != NULL && !feof(stocks)) { sscanf(buf, "%d %d", &stock.x, &stock.y); printf("n1 = %d n2 = %d\n", stock.x, stock.y); total += stock.y; ++numberofrecords; …

Member Avatar for electromania
0
104
Member Avatar for fruitkiwi

>Can u give me some advice to do it ? I can give you some advice, but you're not going to like it. My advice is to take a step back and work on simpler things, because you're trying to solve problems and write programs that are too far beyond …

Member Avatar for jephthah
0
159
Member Avatar for tvisha

[code=c] int main() int next_state[8][2]= {0,4, [/code] The tag for main either doesn't belong there, or should be completed. As it is, you've got a syntax error because of a partial function declaration/definition.

Member Avatar for Majestics
0
659
Member Avatar for g_loughnan

>#define pi 3.14159265; Lose the semicolon. The preprocessor is doing exactly what you tell it and replacing all occurrences of "pi" with "3.14159265;".

Member Avatar for g_loughnan
0
104
Member Avatar for jephthah

A few tips: >printf("File Open Error %s", filename); >exit(0); Most likely you don't want to use stdout for your error messages. At the very least use stderr, and for more robust messaging, use your own stream. Either way you'll be using fprintf. Also, 0 means success, so [ICODE]exit(0)[/ICODE] is functionally …

Member Avatar for jephthah
0
285
Member Avatar for severman

There's no portable way to do this. What compiler and operating system are you using? In anticipation of you being on Windows, you can use [URL="http://msdn2.microsoft.com/en-us/library/ms686047(VS.85).aspx"]SetConsoleTextAttribute [/URL]to give your text color.

Member Avatar for zdaxxy
0
127
Member Avatar for ithelp

I can't say I know of any other than hiring an assembly programmer to tweak your assembly output. How is the compiler not sufficient for your needs?

Member Avatar for Narue
0
65
Member Avatar for knight fyre

Random access is for when you can't predict the access pattern or you can't deterministically work out a pattern to organize your data for sequential access. Sequential access is for when you don't care about the order of records, can predict the access pattern or organize your data to fit …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Drake

>what makes C a universal language C is old, ubiquitous, well understood, and many modern languages derive syntax and semantics from it.

Member Avatar for sDJh
0
106
Member Avatar for melystar

>while((i > 0) && (A[i] > key)); Remove the semicolon. What you have right now is a loop that either doesn't run at all, or runs forever. Here's the equivalent loop with braces: [code=c] while((i > 0) && (A[i] > key)) { ; } [/code] Also, your algorithm is incorrect, …

Member Avatar for melystar
0
163
Member Avatar for Drake

>What are the following data types are and the storage requirements of each? This is something you can find in any C reference. So why are you even asking the question? char is a byte, the size is 1. unsigned char is a byte guaranteed never to have a negative …

Member Avatar for Salem
0
104
Member Avatar for coolerfantasy

>Sorry to hear that. I'm not. We can easily do without people like that.

Member Avatar for Narue
0
152
Member Avatar for NinjaLink

Here's a hint, people. Use a fixed width font to set up spacing for your output. The post editor doesn't use a fixed width font, so open up Notepad or something equivalent and get your example looking right before you post it. Otherwise you'll end up with too many or …

Member Avatar for NinjaLink
0
262
Member Avatar for Ice_Dragon

It looks like you've nailed down the problem, judging by the extra std::cin.get() calls, but putting them after a return statement means they won't get executed. For example, try swapping this pattern: [code=cplusplus] return 0; std::cin.get(); [/code] To get this one: [code=cplusplus] std::cin.get(); return 0; [/code]

Member Avatar for Narue
0
116
Member Avatar for mzdiva041986
Member Avatar for _Jenova

Moved. FYI, "Assembly" in the Software Development->Assembly forum refers to assembly language for software programming, not hardware assembly.

Member Avatar for The New Normal
0
82
Member Avatar for steven woodman

>found this is going to be a lot more work then originally expected What did you expect? I hear this a lot. "It wasn't what I expected!" I get the feeling that people have some pretty messed up expectations when it comes to learning something new. >and have become only …

Member Avatar for Ancient Dragon
0
179
Member Avatar for ckins
Member Avatar for doublediamond

If you define a member function for a template class outside of the class definition, you need to recreate the template parameters: [code=cplusplus] template <typename T> myVector<T>::myVector() { size = 0; capacity = 10; data = new T [capacity]; } template <typename T> myVector<T>::~myVector() { delete [] data; } [/code]

Member Avatar for doublediamond
0
214
Member Avatar for bramprakash1989
Member Avatar for bramprakash1989

What have you tried so far? What exactly don't you understand? Keep in mind that we're not going to just give you the code for your program without some effort on your part.

Member Avatar for Narue
0
212
Member Avatar for vardhani

>there's no such thing as a random number 100% accurate and 0% helpful. >but they're still not random. I don't think anybody here cares but you. If it looks random and acts random for your application, it's random.

Member Avatar for jephthah
0
132
Member Avatar for kartouss

The filename parameter has to be a C-style string: [code=cplusplus] ifstream myfile1 (path1.c_str(), ios::binary); ofstream myfile3 (path2.c_str(), ios::binary); [/code]

Member Avatar for kartouss
0
80
Member Avatar for mohanvamsi_18

>So how can i made calculations on numbers out of Builting data types ranges. Use an arbitrary length math library such as [URL="http://gmplib.org/"]GMP[/URL], or write your own.

Member Avatar for mohanvamsi_18
0
112
Member Avatar for modaslam

Have you tried searching the forum? How about the web? It's not like this question isn't asked on a regular basis.

Member Avatar for Narue
0
133
Member Avatar for Nessie

>why is there no null character needed? Dumb luck. The next byte after your array just happens to have the value 0. >*(array + count) = ch ; Just out of curiosity, why add the unnecessary complexity of pointer notation here?

Member Avatar for Nessie
0
112
Member Avatar for Ancient Dragon

You can specify one or more forums from the advanced forum search. Is that what you meant?

Member Avatar for zandiago
0
60

The End.