15,300 Posted Topics

Member Avatar for vijaysoft1

Forget Turbo C -- its too old. Code::Blocks might work since it used MinGW which is the same compiler that's probably used on *nix, only the compiler was ported to MS-Windows, and it supports many of the *nix standard libraries.

Member Avatar for Ancient Dragon
0
140
Member Avatar for schicksalf

Start here: [code] #include <stdio.h> int main() { // your code goes here } [/code]

Member Avatar for Ancient Dragon
0
174
Member Avatar for Rsh>>>
Member Avatar for kevinn

[b]string[/b] resides in std namespace and you have to tell the compiler what namespace it's in. You have several options (use only one of the options listed below) [list=1] [*] [icode]using namespace std;[/icode] put that after the include files (least desireable option) [*] [icode]using std::string;[/icode] put that after the includes …

Member Avatar for kevinn
0
175
Member Avatar for bkpally263

You can't just simply add gui to a console app. Start out by creating an MFC application (not a console app that supports MFC, but a regular MFC program, then choose either dialog (probably what you want) MDI, or SDI. After the gui app is generated, compile and run it …

Member Avatar for Ancient Dragon
0
149
Member Avatar for cellus205

[QUOTE=Antwane;472017]how do I create a calender program using c++?[/QUOTE] If you were "smarter than a 5th grader" then you could just simply "copy" from the previous poster. But be aware that if he is also wrong you will have to post "I Antwane am NOT smarter than a 5th grader." …

Member Avatar for midgetchris
0
115
Member Avatar for chalgi26

add [icode]using std::string[/icode] after the include files Move the code gards (lines 4 and 5) up before the include files.

Member Avatar for chalgi26
-1
187
Member Avatar for gen84
Member Avatar for Ahmed Helmy
Member Avatar for sexyzebra19

line 105: >> else if (j = 51) You are using the wrong operator. Use boolean == instead of assignment = operator.

Member Avatar for GrubSchumi
0
101
Member Avatar for rel0aded911
Member Avatar for Ancient Dragon
0
80
Member Avatar for Darth Vader

You must be using old version of visual studio. The current version does not use pointers, but the ^ operator [code] List<String^>^ List1 = gnew List<String^>; // etc [/code] Upgrade to either 2008 or 2010 so that you can use newest version of C++/CLR language. As for your question, probably …

Member Avatar for Darth Vader
0
123
Member Avatar for didijc

[URL="http://www.codeproject.com/KB/library/GomzyHTMLReader.aspx"]Here is a c++ HTML reader class[/URL].

Member Avatar for didijc
0
549
Member Avatar for cousinoer5

In getInput() the first thing you need to do is check if the file was opened. Next, don't use eof() because it doesn't work the way you think it does. [code] int getInput(studentType studentData[30], ifstream& indata, ifstream& infile) { infile.open("data.txt"); if( infile.is_open() ) { index = 0; read = 0; …

Member Avatar for cousinoer5
0
178
Member Avatar for fjrivash

Here is another way [code] if( file.is_open() ) { int n, x; float f; file >> n >> x; // get first line setM(n); setX(x); MatrixHandler data(n, n); while( file >> n >> x >> f ) // process remaining lines { // fill in the matrix here } } …

Member Avatar for fjrivash
0
85
Member Avatar for Carrots

Yes because MFC doesn't know a thing about std::string. CString is the data type used by MFC to transfer strings from member variables to/from the MFC controls, such as edit box. There is a lot of code in the CView derived class that will be broken if you just simply …

Member Avatar for Carrots
0
140
Member Avatar for kapil.muni1020

I did not get an error using vc++ 2008 express, compiled for both C and C++ and was ok. So if you have an error then either it is your compiler or you didn't post something.

Member Avatar for Ancient Dragon
0
111
Member Avatar for mindgames
Member Avatar for characteredu

Not really my "favorite", but Wanted is a very very good action movie. If you liked Die Hard you will also like Wanted. I suppose my favorite was Dune. I wore out two tapes because I watched it so many times.

Member Avatar for pritaeas
0
183
Member Avatar for applesplz

To get a random number between 1 and 6: [icode]int num = 1+ (rand() % 6)[/icode]. The rest of that function you should be able to do yourself.

Member Avatar for Ancient Dragon
0
45
Member Avatar for amr123

It's pretty simple, just create an infinite loop. Inside the loop get current time ( time() in time.h ), convert to tm structure ( localtime() ), then just print the hour, minute, and second). How to set the computer's clock will depend on the operating system.

Member Avatar for Ancient Dragon
0
188
Member Avatar for mksakeesh

You can not simply insert stuff into existing lines of a text file. Instead, you have to completely rewrite the file. Open the original file for reading, open a new temp file for writing. In a loop, read each line of the original file and rewrite it with desired changes …

Member Avatar for mksakeesh
0
101
Member Avatar for ahamed101

>>Is there anyway to achieve this? No because the #inc lude directive is processed at compile time, not runtime.

Member Avatar for gerard4143
2
1K
Member Avatar for klackey19

Not surprised by your problem because the code you posted won't compile. You can't run a problem that is just full of crap.

Member Avatar for klackey19
2
308
Member Avatar for Ancient Dragon

Just installed 64-bit Windows 7 Home Premium. So far so good. I did a fresh install, reformatted the hard drive, and installed fresh.

Member Avatar for vegaseat
1
426
Member Avatar for Ancient Dragon

When I hit the Edit button to edit a post there is another active Edit button. Can you remove that button because its confusing.

Member Avatar for The Dude
0
154
Member Avatar for Clinton Portis

you could have just used stringstream to split the line into words without re-reading the file. And it would have been more useful to use vector to hold the lines/words. [edit]I don't see any reason at all for reading the file one character at a time. Too much work just …

Member Avatar for mrnutty
1
195
Member Avatar for taylorc8

C++/CLR (Forms) is just another way to write windows gui programs. The original method, using win32 api functions, is still useful. Here's a common [URL="http://www.winprog.org/tutorial/"]beginner's tutorial[/URL].

Member Avatar for Ancient Dragon
0
87
Member Avatar for mitchstokes225

This minor change made it work when I move first [code] if (choice==1) //if player wishes to go first { bool done = false; do{ cout<<"\n turn = "<<t<<endl; HumanMove(Board); w=CheckWin(Board); if (w==1) { cout<<"Youwin!"; done = true; } else if (w==2) { cout<<"You lose!"; done = true; } else …

Member Avatar for mitchstokes225
0
255
Member Avatar for neel_patric
Member Avatar for J.Turnbull
0
85
Member Avatar for Mattpd

You don't need either of those two programs. To edit a text file just completely rewrite it. Open the original for reading, open a new file for writing, in a loop read a line from the original file, edit it as necessary, then rewrite it to the output file (or …

Member Avatar for Ancient Dragon
0
98
Member Avatar for cmk2901

cout only works with text buffers -- your buffer contains binary information and most likely the very first byte is a 0.

Member Avatar for Ancient Dragon
1
170
Member Avatar for hjazz

>>I'm new to using Visual Studio. I'm currently using VS .NET 2003 on Vista Upgrade to VC++ 2008. You can get free Express version. CLR and MSDN was changed quite a bit since 2003. Not sure why direct.h could not be found. Did you use angle brackets instead of quotes? …

Member Avatar for Ancient Dragon
0
234
Member Avatar for cole davidson

Its a lot easier to sort them if you use an array of 3 integers instead of 3 individual variables. [code] int arry[3] = {0}; for(int i = 0; i < 3; i++) { cout << "Enter an integer\n"; cin >> arry[i]; } // now you can easily sort the …

Member Avatar for cole davidson
0
171
Member Avatar for basketball4567

There are no standard C or C++ functions that will do what you want. Bu8t there are some non-standard functions in conio.h, if that has been implemented by your compiler. You could also probably use something like ncurses library, or other win32 api functions.

Member Avatar for basketball4567
0
109
Member Avatar for NicAx64

Did you try deleting all object files and recompiling everything? If that doesn't work then post the offending source file.

Member Avatar for NicAx64
0
185
Member Avatar for markeen

OMG! Is that some sort of failed attempt to sort the array??? There are lots of sorting algorithms, had you bothered to google for any of them. [URL="http://www.fredosaurus.com/notes-cpp/algorithms/sorting/bubblesort2.html"]Like these[/URL].

Member Avatar for Ancient Dragon
1
120
Member Avatar for scriptkiddy

I've looked at the assembly code quite a bit and have found it contains very little "useless junk". But you can have it produce assembly code listing if you want. Look in the c++ options and there you will see it. Unless you want to hand-code the entire program you …

Member Avatar for Ancient Dragon
0
231
Member Avatar for cmsc

Function add() -- second parameter must also be passed by reference. You are just passing the pointer by value, which does nothing in main()'s copy of the pointer. Note the second parameter should have two stars, not one. [code]int add(int* index, int **a) { } [/code] lint 49: The typecast …

Member Avatar for cmsc
1
90
Member Avatar for caperjack

[QUOTE=BestJewSinceJC;1051978]Not to be repeating myself. . but call of duty came out recently. .[/QUOTE] I suppose that means playing a game is more important than doing homework.

Member Avatar for caperjack
0
155
Member Avatar for cyb3rl0rd1867

I have only seen a couple of incompatabilities -- one of my games that played ok on Vista Home will not play on Win7. Also, the other day I bought a blue-ray video that contained a file that I could copy to my pc. Guess what?? It won't recognize Win7. …

Member Avatar for jbennet
0
330
Member Avatar for turtlez

There are two problems on each of those lines 1) one, two, three, etc are not defined in that function. 2) [b]char[/b] is a data type, but you failed to provide a variable name. For example [icode] char something = 1;[/icode] [edit]What ^^^ said too :)

Member Avatar for turtlez
1
123
Member Avatar for reese27

vector doesn't have a find() method. Maybe what you want is std::map instead of two vectors.

Member Avatar for Ancient Dragon
0
35
Member Avatar for dieom

you can not convert an integer to character array like you tried to do. Use sprintf() instead [icode]sprintf(t, "%ld", i);[/icode]

Member Avatar for Ancient Dragon
0
90
Member Avatar for dewdropz

>>if (length=breadth) you are using the wrong operator -- use == boolean operator instead of = assignment operator. >> shape= 'square'; Two problems with that line [list=1] [*] All strings (two or more characters) have to be enclosed in double quotes, such as "square" [*] variable [shape] can only hold …

Member Avatar for Ancient Dragon
0
209
Member Avatar for kangekraam
Member Avatar for zephy2

>>Vector2<float> m_pVec2Stage[150]; Most likely that line. vectors are by definition arrays. So all you probably need is this: [icode]Vector2<float> m_pVec2Stage;[/icode]. But of course we can't be certain because we don't know how Vector2 was implemented. The only reason I can think of to use the above construct is if yiou …

Member Avatar for twomers
0
485
Member Avatar for ankit_the_hawk

why not just put the number of records in the file followed by all the records. Or just read one record at a time until end-of-file -- you don't need the number beforehand.

Member Avatar for aqtel003
0
220
Member Avatar for SDPRIYA

Using TurboC++ is like riding horse&buggy on todays interstates or autobahns (in europe). Ditch the horse&buggy and get a free modern ferrari.

Member Avatar for Ancient Dragon
0
336
Member Avatar for rahul.nutron

First you have to define the term "microarray data". We are programmers, not biologists.

Member Avatar for Ancient Dragon
0
53

The End.