15,300 Posted Topics

Member Avatar for Nyight

Red color tags do work. just use the [noparse][color=red] ... [/color][/noparse] color tags. Other colors don't work though. [code] [color=red]This is in red[/color] [u]This is underlined[/u] [color=red][u]This is underlined red[/u][/color] This is not in red. [/code] If you use [noparse][code] ... [/code] the above will work as shown. But if …

Member Avatar for Dani
0
197
Member Avatar for tagazin

I didn't get any warnings or errors when I compiled that code with vc++ 2010 Express. Check your code very carefully -- there might be an extraneous character somewhere. AFAIK that compiler should work ok on XP.

Member Avatar for tagazin
0
178
Member Avatar for malvi

When you set up the edit control you told it that you wanted it to be a numeric value by checking the numeric property. When you did that MFC will not permit it to be blank -- it must have a number. If you want it to be blank then …

Member Avatar for Ancient Dragon
0
539
Member Avatar for unique_13

>>how can i solve the data files's problem By writing the program of course :) What have you already written? What don't you understand about the instructions?

Member Avatar for Ancient Dragon
0
188
Member Avatar for student89

The *.pch file is of no use outside the project that created it. Its only purpose it to speed up the compile process of a project. What you have to do is add the *.lib file to the project. There are two ways to do it: 1) Put this in …

Member Avatar for Ancient Dragon
0
131
Member Avatar for Osas106

what compiler are you using? For MS-Windows and Microsoft compilers, use winsock2.h and link the program with ws2_32.lib. Windows does not support Berkley sockets.

Member Avatar for Ancient Dragon
0
93
Member Avatar for ddanbe

Any predictions of world disasters?? Earthquakes, hurricanes, tornadoes, huge sun spots, earth hit by large asteroids, etc.

Member Avatar for nick.crane
2
104
Member Avatar for hoganmadman

From the description I would think you need to read the numbers from a text file, not from the keyboard.

Member Avatar for fdsa99
0
446
Member Avatar for Omni

>>Im interested in IT, what are my chances of working my way up? If you live long enough you will outlive everyone else. Eventually you will be CEO :)

Member Avatar for Master Rattley
0
285
Member Avatar for nalawade41
Member Avatar for Ancient Dragon

I previously posted an MS-Windows example program about how to recursively search folders and create a list of their filename. This program is similar in concept but is for linux. It c++ and uses std::string and std::vector classes to hold the strings. When the program encounters a directory it will …

Member Avatar for Ancient Dragon
0
953
Member Avatar for AndreRet

I don't follow golf -- afterall its no more a sport than computer programming or brain surgery. Anyone can play golf, whether sober or intoxicated; as long as your not passed out you can play the game.

Member Avatar for diafol
0
119
Member Avatar for rohit_static

[code] if(i<n) c[k++]=a[i++]; else if(j<m) c[k++]=b[j++]; [/code] You need to loop through i and j until i == n and j == m. Note that the if statements are not needed. [code] while(i<n) c[k++]=a[i++]; while(j<m) c[k++]=b[j++]; [/code] >>for(loop=0;loop<--k;loop++) Change <-- to just <. You don't want to change the value …

Member Avatar for Ancient Dragon
0
200
Member Avatar for vavazoom

[URL="http://www.cplusplus.com/forum/general/6813/"]Read this[/URL] If you use MS-Windows you can use your 32-bit compiler to read the file if you use win32 api file/io functions instead of std::fstream. AFAIK there are no 64-bit implements of fstream for 32-bit compilers.

Member Avatar for Ancient Dragon
0
219
Member Avatar for mpassaglia

[code] float CalculateFee(float time) { float charge = 2.0F; if( time > 3.0F) { charge += (time-3.0F) * 0.50F; if( charge > 10.0F) charge = 10.0F; } return charge; } [/code]

Member Avatar for Ancient Dragon
0
2K
Member Avatar for veereshcta

1. You should have used code tags when you posted that stuff. No one is going to read that unformatted code. >>How can I replace my buffer using malloc which reads unlimited line Use a linked list.

Member Avatar for Ancient Dragon
0
118
Member Avatar for diagramatic

I perfor { and } on separate lines, inline methods/functions when they consist of only one or two lines, and int main() instead of void main() [code] #include <iostream> using std::cout; int main() { if( somethod ) { cout << "Somethig here\n"; } else { cout << "Something else here\n"; …

Member Avatar for mike_2000_17
0
186
Member Avatar for rizrash

you must mean Turbo C++, not Turbo C. But I don't know why you can't code it in c++. If you expect to get that project done in a week then you will have to work a lot of hours each day -- not much time left for play.

Member Avatar for Adak
0
2K
Member Avatar for saad749

>>Turbo C can display only 16 colors so I will need to use a Windows Interrupt[or something like that] to display the image. Not with that compiler you won't. That compiler can not access any of the win32 api functions. Get a 32-bit compiler such as either Code::Blocks or VC++ …

Member Avatar for Ancient Dragon
0
613
Member Avatar for keeda

Looks like you are doing it the hard way [code] int n1,n2,n3,n4,n5; while( map >> n1 >> n2 >> n3 >>n4 >> n5 ) { // do something with these numbers } [/code]

Member Avatar for nbaztec
0
97
Member Avatar for ganesh_IT

[URL="http://msdn.microsoft.com/en-US/library/6d5tahbt(v=VS.80).aspx"]Read this[/URL]. Call the control's GetTime() method, which returns a SYSTEMTIME structure. That structure contains what you are looking for.

Member Avatar for Ancient Dragon
0
82
Member Avatar for 1bh

>>char *argv[100]; You need to initialize all those pointers to 0, like this: [icode]char *argv[100] = {0};[/icode] Why are you typing in /bin/ls? Doesn't it work with just "ls", like you would type it in the shell? [edit]I tried it just now and it doesn't work either. Not sure what …

Member Avatar for abhimanipal
0
242
Member Avatar for bmos

Add another pointer -- call it tail or something -- that keeps track of the last node. Then when you need the end of the list it will be easily available without taking the time to traverse the entire list.

Member Avatar for Ancient Dragon
0
183
Member Avatar for mi.mac.rules

>>but how can I keep reading it, line by line? That's the purpose of the while statement that you posted. Every time fgets() is called it will read the next line in the file. The "!= NULL" says to keep reading until end-of-file is reaches or some other error occurs. …

Member Avatar for mi.mac.rules
0
2K
Member Avatar for hoganmadman

>>for (i = 0; i < n;++i){ What will happen if you only input 3 numbers? Answer: the final value of sum will be in the crapper because it will add in uninitialized array elements 4-20.

Member Avatar for hoganmadman
1
145
Member Avatar for titan5
Member Avatar for cogitoergosum18

include <string> >>stdev= pow(sum,0.5); sum is a float, but 0.5 is a double. There are no overrides of pow() that take those parameters. change 0.5 to 0.5F to make it a float.

Member Avatar for Ancient Dragon
0
166
Member Avatar for USC_Megoy

>>lab=&(*lab)->next; That is destroying the original pointer. Use a different pointer to iterate through the linked list and leave the original pointer unchanged. Something like the code below (not compiled or tested). You didn't post the definition of struct information, so I'll just assume it contains no other pointers than …

Member Avatar for Ancient Dragon
0
222
Member Avatar for RobBobSmith

Probably something like this (untested) code [code] #include <fstream> #include <vector> #include <string> #include <sstream> using namespace std; int main() { std::vector<std::string> elementVector; std::ifstream in("filename.dat"); std::string line; while( std::getline(in, line) ) { if( line == "<et>" ) { std::getline(in,line); stringstream st; st << line; std::string word; while( std::getline(st,word,''' )) { …

Member Avatar for RobBobSmith
0
253
Member Avatar for fire_
Member Avatar for lukename
0
330
Member Avatar for jimmys_

If you want MS-Windows then probably have to use one or more of the [URL="http://undocumented.ntinternals.net/"]Undocumented Windows API functions[/URL]

Member Avatar for jimmys_
0
571
Member Avatar for Jack_1
Member Avatar for zunnur

post the code you are writing. Are you allowed to use the math coprocessor for log and other math functions ?

Member Avatar for rjong
0
542
Member Avatar for Mr.Barca

why do you need a 1000X10000 array? Another way to do that and simlify it is to create a structure then make an array of structures [code] struct item { vector<int> numbers; int linenum; }; vector<item> items; [/code]

Member Avatar for Mr.Barca
0
121
Member Avatar for qqwushi12345
Member Avatar for bigwhiteegg

bool, true and false are c++ keywords. Just comment out that enum and it should work ok.

Member Avatar for Ancient Dragon
0
130
Member Avatar for lradske

inside the loop that starts on line 50 keep track of the student who has the highest score. Do this by saving the value of the i loop counter into another variable. For example: [code] int highest = 0; for(int z=0;z<list.size();z++) { total+=list[z]->score; if( list[z]->score > list[highest]->score) highest = z; …

Member Avatar for Ancient Dragon
0
117
Member Avatar for Suzie999

character arrays like that can not be returned by any function, whether its in a dll or not makes no difference. You have several options [list=1] [*]Since this is c++ return std::string -- this may have the same problem as described below for #3 [*]add a char array parameter to …

Member Avatar for Suzie999
0
133
Member Avatar for neti1987

I assume you mean on the MS-Windows operating system instead of *nix or MAC. Well, if the program is written in ancii C or C++ then your list shold be empty because the program should compile on all c or c++ compilers.

Member Avatar for Ancient Dragon
0
125
Member Avatar for patrickcage

Welcome to DaniWeb. It's not how old you are when you start but how well you can think and solve problems. I was almost twice your age when I started.

Member Avatar for Ancient Dragon
0
31
Member Avatar for unnamed17

First you have to have mysql server installed on your computer. Then you have to link that program with the mysql.lib that is in the mysql server install directory.

Member Avatar for Ancient Dragon
0
56
Member Avatar for unnamed17

Have you created the database and tables yet? What's the name of the table, and whats the names of the columns? You need to learn the SQL (Structured Query Language). google for tutorials. Briefly, if you want to insert a row into a table INSERT INTO tablename VALUES(1,2,3,4,5) Where 1,2,3,4, …

Member Avatar for Ancient Dragon
0
246
Member Avatar for Nemo_NIIT

by "protected/unprotected code" to you mean "managed/unmanaged code" ? Maybe you should contact NUnit to iron out the problems you have with it. I never used it so I can't help you with it.

Member Avatar for Ancient Dragon
0
97
Member Avatar for NeiLLio

Sounds like you have some studying to do in order to make up that week in the hospital. Your text book probably covers all the material you need to do the program. Start out very simply -- define the class.

Member Avatar for Ancient Dragon
-2
86
Member Avatar for zaacze

[code] scanf("%c",&words[i]);} atoi(&words[i]);} [/code] above is useless. just input the text as normal characters. You don't have to do any conversion at all to get the ascii value of the characters -- data type char already contains the ascii value. To see if its odd or even [code] // get …

Member Avatar for Ancient Dragon
0
176
Member Avatar for unnamed17

You will have to rewrite the entire file. Rea the original file into memory, append the data in memnory, then rewrite the file with the new lines.

Member Avatar for Ancient Dragon
0
100
Member Avatar for srinivasan106

Do you mean how to sort a 2d array based on just one of its columns? For example if you have an array of ints that has 5 columns and 1,000 rows, how to sort it by the contents of column 2 (or some other number) ?

Member Avatar for Ancient Dragon
0
82
Member Avatar for Spartan_MSU12

You are doing it the most diffiult way possible -- reading the file one character at a time. Words are separated in files with white space (spaces and/or tabs). ifstream has >> operator which reads entire words [code] std::string word; ifstream input(filename.c_str()); int counter = 0; // check that file …

Member Avatar for Ancient Dragon
0
127
Member Avatar for Haxifix

int 21h, ax = 09, writes the string in dx to the screen. You would have known that if you had bothered to google for "int 21h".

Member Avatar for Ancient Dragon
0
184
Member Avatar for ana12

I'm having a wonderful time living since I retired from programming a little over 3 years ago. Life is sooo much easier and better. I wake up every day without a care in the world. Even though I still work part time (non programming) I never bring my work home …

Member Avatar for Kusanagi03
0
102

The End.