15,300 Posted Topics

Member Avatar for seaman34

>>*src++; line 9: remove the star -- you need to increment the pointer, not what the pointer is pointing to [icode]src++;[/icode] line 15: >>*src=&temp; //c2440 You can't do that either. *src is a single character and you can not assign it a pointer to a character array temp. I don't …

Member Avatar for p.y.
0
157
Member Avatar for JwhateverJ

Seek to the end of the file and call tellg(), or whatever function boost used to return the current file position.

Member Avatar for JwhateverJ
0
4K
Member Avatar for mrblippy

There are a lot of different kinds of databases, from simple text files, binary files, SQL relational databases (such as MySQL). The node structure doesn't lend itself to binary files very well because of that character pointer. Since the linked list will be relatively short you would probably want to …

Member Avatar for Ancient Dragon
0
116
Member Avatar for lotrgandalf

The value of [b]A[/b] is 60, yet you have a loop that assumes its 600. Change that loop like this: [icode]for(i=0;i<A;i++)[/icode]

Member Avatar for lotrgandalf
0
109
Member Avatar for monkey_king

>>Is this safe to assume its the same on all c++ compilers? No. See limits.h for size limitations. >>Why does 'printf("size of size_t: %d\n",sizeof(size_t ));' make a warning? Probably because size_t is unsigned long and %d is signed int. Try %u and see if the warning persists. >>The size_t is …

Member Avatar for idallen
0
1K
Member Avatar for hlmjohnson1981

line 77: your class does not have a GradePoint() method. You need to add that. If you have learned about overloaded operators yet you could also do it by overloading the > operator so that you can do this: [icode]if( xStudent > yStudent )[/icode]

Member Avatar for tonytheking1
0
195
Member Avatar for MrJNV

Never heard of them either. But after reading [URL="http://cisnet.baruch.cuny.edu/holowczak/classes/3400/relationalalgebra/#selectionexamples"]this[/URL] I tink its nothing more than the WHERE clause in SQL statements. [icode]SELECT Name,Office,Dep,Rank FROM mytable WHERE dep = 'CS';[/icode] That is an SQL example select statement. Put quotes around it, make it a string, then send it to an SQL …

Member Avatar for MrJNV
0
276
Member Avatar for K0ns3rv

>>So my question is, how do I from within the constructor verify that the length of the array is at least 3 ? You can't, which is one big reason vectors were invented. What you might want to do is change the constructor to accept a vector so that it …

Member Avatar for K0ns3rv
0
122
Member Avatar for dualdigger
Member Avatar for tarheelfan_08

It doesn't write to the file because account_details() only writes to the screen. To fix that I would add a parmeter which would be either cout or an ofstream object [code] void Account::account_details(ostream& out) { out << // blabla } [/code] example: [code] #include "stdafx.h" #include <iostream> #include <fstream> using …

Member Avatar for tarheelfan_08
0
213
Member Avatar for jeffhorton1965

You can't make the return value of that function anything other than an integer. Why? Because they are not normal functions -- it acts more like a self-contained process than another function, except that threads have access to all global data in the entire program. So when a thread returns …

Member Avatar for jeffhorton1965
0
203
Member Avatar for raseru

I've worked with MFC pretty extensively, and I can say for certain that it's at times a pain in the ass. I have not worked with it since VC++ 2005. If you're just getting started with GUI then I'd suggest you learn a more portable GUI package which works with …

Member Avatar for Frederick2
1
968
Member Avatar for timbomo
Member Avatar for kvprajapati
-2
1K
Member Avatar for ShortYute

The macro NULL is intended for pointers, not integers, Instead of casting NULL to int why not just pass 0? It would make more sense. Example: line 11 should be like this: [icode] if ( numOfArrays == 0 && sizeOfEachArray == 0) [/icode] Remember: integers are not pointers (normally) so …

Member Avatar for ShortYute
0
160
Member Avatar for 3cats
Member Avatar for R3Slick

I'm confused about what you mean by send to a data file? Or data queue? Are you talking about sockets -- sending packets via sockets to another computer? Or are you talking about copying a file 128 bytes at a time ?

Member Avatar for R3Slick
0
197
Member Avatar for Ancient Dragon

I'm putting my Q. here instead of the c++ board because this is not a c++ question, but rather a compiler question. I just installed vc++ 2010 express and the first difference I noticed is that Microsoft removed the Build menu and all its options. Now there is only one …

Member Avatar for jwenting
0
127
Member Avatar for ankur021190
Member Avatar for Ancient Dragon
-1
63
Member Avatar for Idontknowc

One way I have done it is to use the standard DOS [b]^A[/b] notation. For all values 1-32 just add 'A' and the caret.

Member Avatar for Ancient Dragon
0
323
Member Avatar for yahooak

>>i have googled it, but no solution. Not surprised. You are using a 20-year-old compiler (first released in 1991) that knows nothing about windows long file names and paths, can access only about 400K memory even though your PC might have several gigs, could easily corrupt your hard drive if …

Member Avatar for Stefano Mtangoo
0
108
Member Avatar for Helpgirl

[QUOTE=Helpgirl;1189779]Thank you though, but i dont want all of it, i just do get how i put the array and the loop to get to work together. Thank you :D[/QUOTE] First create an array, such as [icode]int myarray[10];[/icode]. Open a file and read data into each element of the array. …

Member Avatar for Ancient Dragon
-2
155
Member Avatar for angel19

Yes that can all be done, if you have the time, experience, and talent to do it. A GUI version would require a lot of graphics coding, such as creating the bitmaps with some sort of paint program. I don't do that kind of coding so I have no idea …

Member Avatar for angel19
0
113
Member Avatar for fugnut

maybe this will work for you. It doesn't need two counters -- only one is sufficient. If you are trying to read words then why is wordcount an int array instead of std::string array? [code] int countwords(ifstream& infile, int wordcount[MAX_WORDS]) { int count = 0; while( count < MAX_WORDS && …

Member Avatar for Ancient Dragon
0
86
Member Avatar for masumeh--

There could be lots of reasons for that -- other things running on your computer will affect the runtime of your program.

Member Avatar for Ancient Dragon
0
49
Member Avatar for Muhammadlodhi

>>i want to write this program without lib and string files Not possible. You need standard C libraries in order for your compiler to produce the executable program. If you don't want any libraries then you have to first delete (remove) all those header files in lines 1 to 4, …

Member Avatar for Muhammadlodhi
0
123
Member Avatar for vbx_wx

>>enum_key() Change that for loop to a while loop. RegEnumKeyEx() will return ERROR_NO_MORE_ITEMS when done. [code] int i = 0; while( RegEnumKeyEx( /* blabla */) != ERROR_NO_MORE_ITEMS ) { } [/code]

Member Avatar for vbx_wx
0
440
Member Avatar for thriek

Very few, if any, members here know what those SDL functions are. Is that a library of some kind? If it is, post the link to it.

Member Avatar for thriek
0
411
Member Avatar for nahmartin

Writing binary file would be more efficient, but unreadable with any standard text editor such as Notepad. Note that file_out has to be opened in binary mode. [code] file_out.write( (char *) atoms, sizeof( atoms)); file_out.write( (char *)&origin_x, sizeof(origin_x)); file_out.write( (char *)&origin_y, sizeof(origin_y)); file_out.write( (char *)&origin_z, sizeof(origin_z)); [/code] Then to read …

Member Avatar for nahmartin
0
195
Member Avatar for merse
Member Avatar for adrawat

Create an array of pointers, then read each line and add to the array [code] char *data[200]; // 200 lines of data char line[255]; // one line from the data file fgets(line, sizeof(line), fin); data[0] = malloc( strlen(line) +1); strcpy(data[0], line); [/code] Now put the above in a loop so …

Member Avatar for WaltP
0
300
Member Avatar for 3cats

>>When I do a break point the subjectcode is 84 T. Is the 84 the equivelant to T? Yes -- look at any [URL="http://www.asciitable.com/"]ascii chart[/URL] and see for youself. subjectcode is declared as char, therefore the >> operator will treat is as such. Declare it as an int then test …

Member Avatar for 3cats
0
168
Member Avatar for tinkeydo

Download and install MySql++. Its a free c++ class for MySQL databases. Of course you will have to have MySQL installed on your computer. If you have VC++ 2008/2010 Pro or better edition I believe it has all the plugins you need to create and maintain databases. But if you …

Member Avatar for Ancient Dragon
0
123
Member Avatar for sah15

That's supposed to be the class constructor, so code it like this [code] Triangle::Triangle(int side1,int side2,int side3) { } [/code]

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

move lines 9-11 up to between lines 1 and 2. As coded, line 4 can not use cout because it doesn't know what cout is. Other than that, what is the problem with your program?

Member Avatar for chec13
0
167
Member Avatar for coder19

Find out where you are calling fscanf() then check that the FILE stream has been opened successfully (check if it's not NULL). You probably are not checking if fopen() succeeded.

Member Avatar for coder19
0
94
Member Avatar for gnarlyskim

>>Does this mean I have an error within the program, Yes, your program is buggy. Coding and getting a clean compile is only about 25% the job of a programmer. The other 75% if fixing bugs. >>or could there be an error in the compiling process? Unlikely. Don't blame the …

Member Avatar for gnarlyskim
0
88
Member Avatar for james8901

read the file as integers not strings. Then just keep track of the maximum integer read. If you use ifstream then the >> operator will convert the number to an integer, your program won't have to do the conversion. [code] int number; ifstream in("filename.txt"); while( in >> number) { } …

Member Avatar for Ancient Dragon
0
160
Member Avatar for warlock07

google for binary search algorithms. [edit]Oops! Didn't see firstPerson's response.

Member Avatar for warlock07
0
208
Member Avatar for Voltron160

>>There is a yearly membership fee of $500.00 and a monthly usage fee of $3500.00. I would attend a different fitness club. Gold Gym only charges about $35.00/month. And the last time I checked the YMCA was $45.00/month. Why would I want to spend $3,500.00/month for that crappy health club? …

Member Avatar for jephthah
0
128
Member Avatar for Wert1

>>The little programm should run and close another aplication Nope. Not even close to doing that. It is starting 4 programs, not stopping them. >>int time[arrayLength]; Rename that array because [b]time[/b] is a function name. >> int w = Time; why? you don't need that extra variable in your program. …

Member Avatar for mitrmkar
0
345
Member Avatar for Rashakil Fol

You need to make that a blinking sign that changes color frequently so that people will notice it. And the letters should scroll across the screen similar to scrolling banners.:)

Member Avatar for Ancient Dragon
0
318
Member Avatar for timbomo

Your terminology sucks -- its "reading the data file", not "importing" it. Your program is reading the data file all wrong. google for and read tutorial about "c++ file i/o".

Member Avatar for timbomo
0
160
Member Avatar for fyp

Also scroll down the page and check the box "Disable Smilies" so that all those smilies do not appear.

Member Avatar for Ancient Dragon
-1
173
Member Avatar for pramoda.ma

write a recursive function to do it. But don't make the two arrays very large because recursion takes up a lot of stack space.

Member Avatar for Ancient Dragon
0
5K
Member Avatar for fyp

So just add the full path to the filename. [code] str = "C:\\user\\user\\Desktop\\history\\" + str; str += ".txt"; [/code]

Member Avatar for fyp
0
104
Member Avatar for dakkar

Just go to your CONTROL PANEL (see the link at the top of the page) and change your profile settings.

Member Avatar for jwenting
0
56
Member Avatar for bigdawgg

Ok -- so what is your question? If this is on your final exam then that means you are at the end of your course. At that point you should already know how to read a file into arrays.

Member Avatar for jwenting
0
191
Member Avatar for Dire Chess

Why did you define NULL_CHAR? Most people just use NULL definition that standard C header files already define. There is no point defining your own. The function's return value shloud be [b]char*[/b] (you need to add the star)

Member Avatar for Dire Chess
0
110
Member Avatar for rtllz

A file can not be opened by merely giving fstream the path. It also need the filename. And use fstream's open() method. Search the net because there are billions of examples.

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

[QUOTE=Muhammadlodhi;1189386]I need your help AT ONCE plz IN C CODE ONLY [/QUOTE] Go get stuffed. I wouldn't help you now even if I wanted to just because of your crappy attitude.

Member Avatar for Nick Evan
-5
136

The End.