15,300 Posted Topics

Member Avatar for shadowfire36

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; …

Member Avatar for shadowfire36
0
110
Member Avatar for kv79

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

Member Avatar for kv79
0
99
Member Avatar for 26933

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]

Member Avatar for Salem
0
157
Member Avatar for somita1

[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.

Member Avatar for Joolz
0
164
Member Avatar for mattyd

[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 …

Member Avatar for ~s.o.s~
3
10K
Member Avatar for Traicey

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. …

Member Avatar for Traicey
0
129
Member Avatar for ohhmygod
Member Avatar for n.aggel

>>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 …

Member Avatar for n.aggel
0
173
Member Avatar for BigFormat

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 …

Member Avatar for BigFormat
0
2K
Member Avatar for Cafetero

that first, outside loop is wrong. [code] string lineFromFile; while( getline(fin, lineFromFile) ) { // blabla } [/code]

Member Avatar for Duoas
0
158
Member Avatar for Maulth

I'm confused -- you want to write a c++ SQL class but you don't know the SQL language yourself ??:icon_eek:

Member Avatar for Maulth
0
177
Member Avatar for marti3a3

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 …

Member Avatar for marti3a3
0
85
Member Avatar for InfernalDrake

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 …

Member Avatar for InfernalDrake
0
79
Member Avatar for toolbox03

All files are automatically time stamped by the file system when saved or changed. So what else do you want to do with it ?

Member Avatar for jephthah
0
99
Member Avatar for Jennifer84

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 …

Member Avatar for Duoas
0
150
Member Avatar for andy_aphale

>>pls guys give me complete program code its urgent. Don't be so lazy. You write program, we only help.

Member Avatar for Salem
0
144
Member Avatar for nagaa

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 …

Member Avatar for Ancient Dragon
0
136
Member Avatar for sagz

once you get the word or phrase iterate through it one character at a time and remove the punctuation marks.

Member Avatar for sagz
0
174
Member Avatar for GPXtC02

[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 …

Member Avatar for GPXtC02
0
129
Member Avatar for CoolGamer48

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]

Member Avatar for CoolGamer48
0
172
Member Avatar for c++noobie

[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 …

Member Avatar for Ancient Dragon
0
93
Member Avatar for Nemoticchigga

[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 ?

Member Avatar for tesuji
0
99
Member Avatar for tiney83

>>Should i just have a 20x8 array and enter the data that way? Yes, I think you have the right idea.

Member Avatar for Ancient Dragon
0
100
Member Avatar for qurat

Please post the code you wrote -- I left my crystal ball at home this morning. And please read the links in my signature.

Member Avatar for Prabakar
0
85
Member Avatar for RyanLeaf

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 …

Member Avatar for Colin Mac
0
359
Member Avatar for joshmo
Member Avatar for shinpad

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); …

Member Avatar for Nick Evan
0
126
Member Avatar for Aamit

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 …

Member Avatar for Prabakar
0
619
Member Avatar for ryanlcs

>>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 …

Member Avatar for ryanlcs
0
156
Member Avatar for sagz

>>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 …

Member Avatar for sagz
0
157
Member Avatar for Traicey

Took about 10 seconds to find the answer here [URL="http://www.google.com/search?hl=en&q=C+bubble+sort"]Here[/URL]

Member Avatar for DigitalPackrat
0
404
Member Avatar for satanix

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]

Member Avatar for satanix
0
107
Member Avatar for Roofus

>>But is it possible to convert a string object to an istream obj No. Why would you want to do that anyway ?

Member Avatar for Roofus
0
2K
Member Avatar for Alishaikh

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]

Member Avatar for Ancient Dragon
0
89
Member Avatar for gazoo

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 …

Member Avatar for tesuji
0
895
Member Avatar for En1ro

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; …

Member Avatar for En1ro
0
138
Member Avatar for Kumar Arun

Welcome to DaniWeb. This discussion was moved to VB.NET technical board. Continue it there instead of here.

Member Avatar for Serunson
0
64
Member Avatar for marcelomdsc

[URL="http://www.nyu.edu/pages/mathmol/textbook/scinot.html"]tutorial here[/URL]

Member Avatar for marcelomdsc
0
75
Member Avatar for rigers
Member Avatar for Ancient Dragon
0
96
Member Avatar for BMP1980

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 …

Member Avatar for muta
0
252
Member Avatar for jephthah
Member Avatar for knapshots

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.

Member Avatar for Ancient Dragon
0
76
Member Avatar for Jennifer84

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.

Member Avatar for Radical Edward
0
194
Member Avatar for nabeelcool17

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.

Member Avatar for nabeelcool17
0
91
Member Avatar for wam2

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. …

Member Avatar for wam2
0
378
Member Avatar for Kumar Arun

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 …

Member Avatar for Kumar Arun
0
174
Member Avatar for GigaCorp

>>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 …

Member Avatar for GigaCorp
0
140
Member Avatar for awoc

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.

Member Avatar for jephthah
0
89
Member Avatar for n1337

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. …

Member Avatar for Ancient Dragon
0
94
Member Avatar for tiney83

line 59: use [b]index[/b] variable instead of numstudents. [icode]in>>person[index].studentFName>>person[index].studentLName>>[/icode]

Member Avatar for tiney83
0
140

The End.