15,300 Posted Topics
Re: line 155: >> matches[matchesCounter].Season [b]matches[/b] is an array of [b]unallocated[/b] pointers, so you have to use the pointer operator, like this: [icode]matches[matchesCounter][color=red]->[/color]Season[/icode] Before you can do the above you have to allocate memory for the structures. Here's how: [code] int matchesCounter=0; while(!inFile.eof()) { //read season [color=red] matches[matchesCounter] = new Matches; … | |
Re: Go to menu Tools --> Editor options, then select the General Tab. In the lower right-hand side is where you set the tab size. But you may also have to turn off Smart Tabs | |
Re: If this is the original function [code] int foo(int x) { while(x < 10) x = x + 1; return x; } [/code] Then you can do this: [code] int foo(int x) { if(x < 10) { x = x + 1; foo(x); } return x; } [/code] | |
Re: [URL="http://www.google.com/search?hl=en&q=XDE"]google gave 1,400,000 hits[/URL] for XDE. :-O which one(s) are you talking about. | |
Re: [QUOTE=WaltP;340263] What?!?!? Jesus is the reason Pilate and Herod existed? Absolutely illogical, my dear. That's like saying that oxygen exists simply because we breath it. It's proven that they both existed. They are in historical records. Facts prove you wrong here. Whether or not Jesus existed has [/QUOTE] She was … | |
Re: If you have a lot of classes that can be used in several different projects then put the classes in a library or DLL. That way you only have to complie the classes once. Then you tell the compiler to link the application program, that includes main(), with the library. … | |
Re: you opened the file for reading, not writeing. | |
Re: >>I think that i can use pthreads in c++ code but is there any way to use threads in c++ ,in an object oriented manner? There might be some obscure c++ objects out there, such as the Microsoft Foundation Class (MFC) which is only useful for wring MS-Windows windows. Boost … | |
Re: Passing by reference only means to pass a pointer, and all arrays are always passed by reference, never by value. It is not necessary to pass a pointer to a pointer. Passing by reference means to pass a pointer, and [b]String[/b] is already a pointer. All that function needs is … | |
Re: that first, outside loop is wrong. [code] string lineFromFile; while( getline(fin, lineFromFile) ) { // blabla } [/code] | |
Re: I'm confused -- you want to write a c++ SQL class but you don't know the SQL language yourself ??:icon_eek: | |
Re: you are making a mountain out of a molehill. Your code is much too difficult. [code] //Creating my class members ifstream infile; Rocket ship; //My arrays initialized to 0 float alltime [7528][color=red] = {0};[/color] float allheight [7528][color=red] = {0};[/color] float allv [7528][color=red] = {0};[/color] float alla [7528][color=red] = {0};[/color] //Creating … | |
Re: puts() adds the '\n' to the end of the string. call printf() instead [icode]printf("SHELL>");[/icode] >>In the past time, i've been used terminal libraries like the infamous conio.h in turboc That is what you get for learning ancient and obsolete version of C compilers. They teach you very bad habits that … | |
Re: All files are automatically time stamped by the file system when saved or changed. So what else do you want to do with it ? | |
Re: The reason the sort comes out screwy is because [b]3A[/b] is actually less than [b]20A[/b]. If you want them sorted the other way around you have to make the strings the same size, like this: [b] 20A 03A -03A -20A [/b] Then the above will sort as, which is exactly … | |
Re: >>pls guys give me complete program code its urgent. Don't be so lazy. You write program, we only help. | |
Re: Do you know how to do file i/o using FILE* pointer and associated functions found in stdio.h ? If not, then read [URL="http://www.learn-programming.za.net/programming_c_learn10.html"]this tutorial[/URL]. To complete your homework you will have to write a program that does what you described. use two file handles -- one to read the control … | |
Re: once you get the word or phrase iterate through it one character at a time and remove the punctuation marks. | |
Re: [quote]Most are telling me either i can't access the private member variable IDs or the other member variables i'm attempting to access [/quote] [b]private[/b] means just exactly that -- only the class itself can access private members. Work around: write get() and put() public methods to make private members available … | |
Re: what is wrong is that you should not put executable functions in header files, unless they are methods in a c++ class. you can put those functions in your own class [code] class MyMath { public: // put your functions here }; [/code] | |
Re: [quote]In the current program I am using *argv[], so I can access it through argc, but is there a way to find that number without a second variable in case I do not have access to something like argc in another variable? [/quote] Maybe yes, and maybe no. It all … | |
Re: [QUOTE=Nemoticchigga;606142]messageBuf is not being filled with anything. I know the port is open cause writing works fine. Any ideas why this is?[/QUOTE] What do you have attached to the COM1 port that will transmit data to your computer ? | |
Re: >>Should i just have a 20x8 array and enter the data that way? Yes, I think you have the right idea. | |
Re: Please post the code you wrote -- I left my crystal ball at home this morning. And please read the links in my signature. | |
Re: See the [b]Read Me Starting "C"[/b] at the top of this board. You posted right over it. Its good that you are studying assembly language but I would not have picked it as my first programming language because assembly is not considered a good way to program. That is, the … | |
| |
Re: line 19: >> if !(ScheduledIn == ("y" || "n" || "Y" || "N")) Formed wrong. [icode] if !(ScheduledIn == "y" ||ScheduledIn == "n" || ScheduledIn =="Y" ||ScheduledIn == "N"))[/icode] The other if statements have similar problem. You can shorten it up by converting to upper-case first [code] ScheduledIn = toupper(SchecduledIn); … | |
Re: As previously mentioned you should not use feof() to control that loop. Here is the correct way. You also have a problem by assuming that each read of the file will read exactly BufLen bytes. That may or may not be true. fread() will return the number of bytes read … | |
Re: >>Now I am on my way to develop C++ using Visual Studio .Net 2003. Bad idea. Upgrade to VC++ 2008. The Express edition is free for the downloading. >>Somehow, none of those project recognize the code, I get this error VC++ uses precompiled headers and the very first include file … | |
Re: >>e.g. 'The' occurs 25 times (one word phrase), 'negative refractive index is' occurs 12 times (four word phrase) How about "The negative refractive index is" -- Is that one phrase or two phrases. Or is it 5 one-word phrases ? In otherwisds, the description you have posted is ambiguous and … | |
Re: Took about 10 seconds to find the answer here [URL="http://www.google.com/search?hl=en&q=C+bubble+sort"]Here[/URL] ![]() | |
Re: don't use open(), instead use fopen() because FILE* and associated functions are much easier to use. [URL="http://www.cprogramming.com/tutorial/cfileio.html"]Here is a file i/o tutorial[/URL] | |
Re: >>But is it possible to convert a string object to an istream obj No. Why would you want to do that anyway ? | |
Re: Your read loops are incorrect. There is a couple extra steps you have to take. The vectors are initially empty, so one way to do it is to append each string like this: [code] string ln; for( int i= 0;i<25;i++) { fin >> ln; fname.push_back(ln); } [/code] | |
Re: line 47: get rid of the [b]else[/b]. And check if dd is not greater than the number of days in the month, such as [icode]if( dd < 1 || dd > months[dd-1] )[/icode] line 65: delete it. Do not do that whether its a leap year or not. The only … | |
Re: lines 21-30. The operator >>. When inputting std::string you don't use the c_str() method. There's how to code that [code] friend fstream& operator>>(fstream& fs, const gydytojas& obj) { fs >> obj.vardas; >> obj.pavarde; >> obj.adresas; >> obj.gydid; >> obj.amzius; >> obj.specialyb; >> obj.telefonas; >> obj.asmkod; // reading code return fs; … | |
Re: Welcome to DaniWeb. This discussion was moved to VB.NET technical board. Continue it there instead of here. | |
Re: [URL="http://www.nyu.edu/pages/mathmol/textbook/scinot.html"]tutorial here[/URL] | |
Re: You posted your homework, now post the code you have written to solve it. | |
Re: Oracle is only one of several popular database. Getting a certificate in Oracle will do little to nothing for you if you work for a company that has some other database. To become a DBA you need a few years of practical experience working in a large database shop and … | |
Re: And rep points don't count here in the coffee house. | |
Re: Your post has two flaws: 1) it assume the user is running *nix operating system. That may, or may not be correct. 2) Your post is irrelevent because it has nothing at all to do with using the clock() function. | |
Re: Yes, create your own message box using a dialog box, then set up a timer event to kick off in 2 seconds. In the timer event handler destroy the dialog box. | |
Re: You mean a GUI program? If MS-Windows you have to write a windows program, not a console program. [URL="http://www.winprog.org/tutorial/"]Here [/URL]is a simple introduction tutorial. It requires a basic knowledge/understanding of C ir C++ language. | |
Re: 1) Stop coding in ancient K&R original style. That style has not been used for at least 20 years that I know of. [code] __declspec(dllexport) void simuser (double t,double delt,double* in,double* out) { } [/code] 2) I don't see in the main() that you posted where simuser() is getting called. … | |
Re: You need to be careful about transferring files from MS-Windows platform to *nix or other platforms. MS-Windows uses two bytes to indicate end-of-line while *nix, MAC and others use only one character. So if you read text files in binary mode and send that to other operating systems the receiving … | |
Re: >>fflush(stdin); fflush is not defined for input streams, only output, so the above may or may not work. Is this supposed to be a C or a C++ program. Looks like C, but you have tossed in iostream for some unknown reason. Whay did you write all that unnecessary pointer … | |
Re: Look at the format specifiers [URL="http://www.cplusplus.com/reference/clibrary/cstdio/printf.html"]here[/URL] and you will find the one you want. | |
Re: implementation is compiler dependent. If you want to know the nitty-gritty details then just read the <vector> header file, if you are brave enough. And write a small test program then let your compler produce the assembly language for it, that will give you the machine-level code you asked for. … | |
Re: line 59: use [b]index[/b] variable instead of numstudents. [icode]in>>person[index].studentFName>>person[index].studentLName>>[/icode] |
The End.