15,300 Posted Topics

Member Avatar for floatingDivs

Assuming there are other lines in the file that have other tags at the beginning of the line, I would use getline() to read the entire line, then use stringstream to split it up into words. If you just use >> operator you won't know the difference between lines -- …

Member Avatar for LevyDee
0
122
Member Avatar for andimiami

In DisplayData() you need a loop [icode]for(int i = 0; i < NUM_STU; i++)[/icode]. Then within that loop diaply the loop counter followed by each array value [code] cout << i+1 << " " << student_avg[i] << " "; for(int j = 0; j < NUM_QUIZ; j++) cout << matrix[i][j] …

Member Avatar for andimiami
0
163
Member Avatar for sergent

You can use some non-standard functions found in conio.h, assuming your compiler supports them. [code] time_t t1 = time(0); time_t t2 = t1 + 60; // one minute timeout while( !_kbhit() && t1 < t2) { // do count-down timer Sleep(100); // delay 100 milliseconds t1 = time(0); } if( …

Member Avatar for sergent
0
2K
Member Avatar for Dean_Grobler

I want absolute silence. Trying to write code while listening to anything is just too distracting because I tend to listen to music and not pay attention to what I'm coding. Its a little like trying to code while intoxicated. Can't be successfully done.

Member Avatar for evanism
0
215
Member Avatar for gerard4143

I don't know how to initialize it, but try this and your solution doesn't work. My suggestion is not to put const variables inside structures. It wouldn't make any sense to put them inside a structure anyway because by definition you set a const variable to a single value which …

Member Avatar for Narue
0
164
Member Avatar for ziggystarman

When you pull the rug out from under an executing program there is no guarentee that the operating system can kill the process cleanly. Using that taskkill.exe should be a last resort.

Member Avatar for ziggystarman
0
181
Member Avatar for sanjay11

I'm from USA -- we don't play the game here, so I'll bet on England because I lived thee 3 years in 1980s when Iron Lady was PM.

Member Avatar for jingda
0
1K
Member Avatar for Clinton Portis

line 92: isdigit is a macro that returns a bool value (true or false, 1 or 0) You can not compare it with a value as you have tried to do in that line. Other errors I found are just careless errors, such as misspelled function names. Check the error …

Member Avatar for Clinton Portis
0
244
Member Avatar for sergent

You don't need a switch statement for that. objectclass* objects = new objectclass[numberfobjects]; or use a vector of objects vector<objectclass> objects; objects.resize(numberofobjects);

Member Avatar for WhiZTiM
0
193
Member Avatar for eman 22

just include <list> header file. [URL="http://www.sgi.com/tech/stl/List.html"]See this link[/URL] [code] #include <list> using std::list int main() { list<int> MyList; } [/code]

Member Avatar for eman 22
0
85
Member Avatar for Dean_Grobler
Member Avatar for rubberman
0
139
Member Avatar for jeffpro

Maybe you are doing it wrong. [quote=Wiki] DirectDraw is used to render graphics in applications where top performance is important [/quote] I don't use DirectDraw so I don't know if that's really true or not. [URL="http://en.wikipedia.org/wiki/DirectDraw"]Here[/URL]'s the source of that quote.

Member Avatar for jeffpro
0
92
Member Avatar for CrumbledCookies

line 18 initializes all array elments to 0. Therefore, line 28 can never find one whose value is anything other than 0. When the loop is first entered, the value of counter is 0 and the value of studentGPA[0] is also 0. The next iteration of the loop the value …

Member Avatar for CrumbledCookies
0
2K
Member Avatar for megaLU

So, your program is trying to make 31,536,000 memory allocations (86400 X 365) ??? how much memory is being allocated at one time? Is any of the memory ever released?

Member Avatar for rubberman
0
187
Member Avatar for shauzi158

There are several ways to allocate arrays, here is just one of them. [code] int rows = 10; int cols = 2; int **arry = new int*[rows] for(int i = 0; i < rows; i++) arry[i] = new int[cols]; [/code] If you need all the memory to be in one …

Member Avatar for Ancient Dragon
0
111
Member Avatar for Ancient Dragon

I tried to write up a test program that uses std::copy and istream_iterator to copy one text file to another. But it doesn't work because the '\r' and '\n' in the file are lost. I've tried opening the input and output files in text mode and I've tried opening them …

Member Avatar for vijayan121
0
717
Member Avatar for zaneulhaq

[URL="http://www.deitel.com/articles/cplusplus_tutorials/20060225/virtualBaseClass/"]use diamond inherentence[/URL] [code] class A { public: A() {x = 0;} protected: int x; /*Variables required by A, B, C and D */ /*functions required by B and C*/ }; class B : public A { }; class C : public A { }; class D : public B, …

Member Avatar for Stefano Mtangoo
0
410
Member Avatar for Rakesh Mall

I have no clue. Where did you see that? Quote some of the surrounding text in which that appeared.

Member Avatar for Ancient Dragon
0
48
Member Avatar for maybnxtseasn

When you say "injecting" do you mean LoadLibrary()? If not, then what exactly do you mean.

Member Avatar for Ancient Dragon
0
97
Member Avatar for dumb.king12

your example is wrong. What about the two Ns in Bunny and the s's in Mississippi? DID THE BUNY GET THE MISISIPI MAPS FROM B One problem with that is there is no way to recreate the original sentence. In any event, you will have to show is what you …

Member Avatar for Ancient Dragon
-1
78
Member Avatar for Xlphos

See his 24 Nov 2009 post -- with -2 rep. TheDude also got bad reped twice in this thread. Don't know if those are new or old reps.

Member Avatar for The Dude
2
1K
Member Avatar for JDevelop

you could create an 18-byte character array, assuming 8 bits to the byte. Files do not contain bits -- they contain bytes, and the number of bits to the byte is operating system dependent. On MS-Windows and *nix there's 8 bit to the byte. So 128 bits would be 128/8 …

Member Avatar for JDevelop
0
2K
Member Avatar for baby_c

scanf("%s" ...) stops reading keyboard input at the first space. So if you type "John Doe" all scanf() will return is "John". The word "Doe" will be left in the keyboard buffer, so the next time scanf() or gets() is called it will grab "Doe" and not let you type …

Member Avatar for WaltP
0
218
Member Avatar for jamesbondbest

The simplest way to write that program would be to use strtok() function. But if you are not permitted to use that, then you will just have to write your own. >>char *ptr[count+1]; C99 will not allow you to do that, but vuture versions of C may. For now you …

Member Avatar for Ancient Dragon
0
81
Member Avatar for kumarmpk4u

The error message says it all -- you are trying to link together two *.obj files that contain the same function.

Member Avatar for Ancient Dragon
0
125
Member Avatar for virtue

All you have to do is swap the data item of the two nodes -- just like you would swap any two integers. And please use code tags the next time you post code so that people can read it.

Member Avatar for Ancient Dragon
0
181
Member Avatar for frogboy77

It took several years before I could write C code without use of a very good reference book next to my computer. I was constantly looking up functions and their parameters just to make sure I was coding it correctly. Then I learned to use debuggers and how to use …

Member Avatar for jonsca
0
123
Member Avatar for M3SSIAH

You mean something like this? [code] #include <stdio.h> #include <stdlib.h> #include <ctype.h> #pragma warning(disable: 4996) int main() { char line[] = "00 00 57 8B CB 89 5D"; unsigned char bytes[40] = {0}; char* ptr = strtok(line," "); int index = 0, i; char* end = 0; while(ptr != NULL) …

Member Avatar for M3SSIAH
0
306
Member Avatar for finchh

This is a very simple program that should give you a little practice with reading and writing simple text files. You need to use ifstream for input file, and ofstream for output file. Then in a loop, read a number, square it, then write it out to the output file. …

Member Avatar for Ancient Dragon
0
165
Member Avatar for jingda

You can contribute to threads even if you don't know the answer to the original question. If you find a thread where someone answers it and you don't understand the answer, then go ahead and ask for more clarification about what you don't understand. But be careful here not to …

Member Avatar for Ezzaral
1
171
Member Avatar for triumphost

If you only know part of the string then use enum windows, then in the callback function call GetWindowText.

Member Avatar for Ancient Dragon
0
282
Member Avatar for IT cllge stdnt

Thank you for spending many years in our military -- I for one know what that is like and am able to better appreciate the sacrifices you are making. As for that "high paying" job --- what do you consider to be high paying? And where? A bachelor's degree will …

Member Avatar for JhonMoney
0
312
Member Avatar for jowana

Best place to ask those questions is on the ITK's mailing list. Read the *.pdf file from [URL="http://www.itk.org/ITK/resources/software.html"]this link[/URL]. They are the experts, not us.

Member Avatar for Ancient Dragon
0
178
Member Avatar for shinsengumi

No command. You have the write the code to do that yourself. Write down on a piece of paper the original string. Then using your pencil try to delete and insert the new text. Doing that visually may help you to understand more clearly how it might be done with …

Member Avatar for Adak
0
584
Member Avatar for debasisdas

[QUOTE=VernonDozier;1514824]Consider the source. Your comment was completely on the mark and justified and you got down-voted precisely BECAUSE it was completely on the mark and justified. Upvoted from me as a counterbalance.[/QUOTE] Ditto

Member Avatar for VernonDozier
0
203
Member Avatar for triumphost

>> Yes the program is open source but I dont wanna compile How do you expect to accomplish the goals you posted if you don't recompile the program???? :icon_eek:

Member Avatar for triumphost
0
126
Member Avatar for Ancient Dragon

I've seen this happen a couple of times recently, when I give positive rep the member's rep count seems to either not change or go down. See [URL="http://www.daniweb.com/software-development/cpp/threads/356693/1520030#post1520030"]this post[/URL] for example. Then look at the reps give in his profile page. The one I just gave him isn't there. Also …

Member Avatar for Dani
0
196
Member Avatar for jerbElijah
Member Avatar for KumarUtkarsh
-3
303
Member Avatar for abhimanipal

In C language the return value from malloc() does not need to be typecast at all. But if you do use typecast then it needs to be typecast to the appropriate type. For example the line 3 you posted the return value of malloc could not be typecast as char* …

Member Avatar for nezachem
0
142
Member Avatar for lissi

You're using the wrong compiler. What you have is old and buggy. Replace it with Code::Blocks, whieh is current . You will want the version that is supplied with MinGW compiler.

Member Avatar for Ancient Dragon
0
100
Member Avatar for DoubleM1990

You mean search programs similar to *nix grep? There already is a MS-Winows port of grep, which is adequate for all my needs.

Member Avatar for Ancient Dragon
0
34
Member Avatar for cyberbemon

>>for(t=0; t<&numberOfThreads; t++) That is attempting to compare integer t with a pointer to numberOfThreads. Why the pointer? Remove the & pointer operator and it will be ok. line 60: void functions can not return a value. lines 63 and 64 are not inside any function. Format your code better …

Member Avatar for Ancient Dragon
0
177
Member Avatar for codeyy

If you can't use c++ objects then use FILE* and call fgets() in a loop until end-of-file is reached, counting the number of iterations of the loop. When done, you will have the number of lines in the file.

Member Avatar for Adak
-1
562
Member Avatar for nihaS

Depends on what you are talking about. [URL="http://support.microsoft.com/kb/178480"]Here[/URL] is one explanation.

Member Avatar for rubberman
0
1K
Member Avatar for aidasyafiqin

I assume you already know enough assembly language to at least start that project. Teachers don't just toss a project like that at on the first day of class. So, get started and post what you have done. You will probably want to write some pseudo code first so that …

Member Avatar for Ancient Dragon
0
108
Member Avatar for Ancient Dragon

[rant] Its so damed confusing and difficult to use. I spent three days trying to install something on my Fedora 11 machine that would take me no more than about 10 minutes in Vista (or any other version of MS-Windows). As an example: wxWidgets. I couldn't even successfully compile their …

Member Avatar for jwenting
0
587
Member Avatar for ImDead

You have already done the hard part. What don't you understand about calculating the median? Just sort the array and select the value in the center of the array. There are many sorting algorithms, the easiest one (but also the slowest one) to code is the [URL="http://en.wikipedia.org/wiki/Bubble_sort"]bubble sort[/URL].

Member Avatar for abhimanipal
0
160
Member Avatar for Ancient Dragon

>>Ok, so time() function (argument being null) returns what? It returns the number of seconds since 1970, as you previously posted. It doesn't matter whether the parameter is NULL or not, it will always return the same value.

Member Avatar for Ancient Dragon
0
372
Member Avatar for major_tom3

The only thing I find annoying is, when editing a post, having to use the mouse to move the focus to the "reason for editing" box. In previous versions of DaniWeb the tab key sent the focus to that box. I would think its just a simple matter of changing …

Member Avatar for Dani
1
191
Member Avatar for Unseen Machine

It's bad coding to do what openRecords() is doing. The ifstream object should be declared in main then passed by reference to OpenRecord() [code] int main () { //Title cout << " Employee sales records.\n" << endl; //Get the file stream or quit if the records file is not found. …

Member Avatar for mike_2000_17
0
344

The End.