Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
3
Posts with Upvotes
3
Upvoting Members
3
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
2 Commented Posts
0 Endorsements
Ranked #2K
~10.7K People Reached
Favorite Forums
Favorite Tags

24 Posted Topics

Member Avatar for Cosa

[code=c++] for (int i=0; i<rowsa; i++) { for (int j=0; j<columnsb; j++) { float sum = 0.0; for (int k=0; k<columnsa; k++) { //first, look it as a two-dimensions array, you will get the following expression //sum += matrixa[i][k] * maxtrixb[k][j]; //then convert it to one-dimension array, you will get …

Member Avatar for kabultanha
0
4K
Member Avatar for littlestone
Member Avatar for cpp_noobsauce

[QUOTE=cpp_noobsauce;586700]Thanks for that. As I said I know that there are several errors in this code, thanks for helping fix that one. Any help with how to replace an instance of a character in the array with the first character of the array would be greatly appreciated :)[/QUOTE] [code=C++] int …

Member Avatar for Salem
0
240
Member Avatar for littlestone

Does it need a copy constructor and an operator= for a class which have array member? for example: Class A { private: B data_[100]; //B is a class }; does class A need a copy constructor and an operator? in other words, is the default copy constructor is OK for …

Member Avatar for abhijitm
0
212
Member Avatar for littlestone

Some of my source files include the following code. [code] #ifndef AAAAAAAAAAAA #define AAAAAAAAAAAA #if !defined(__lint) && !defined(_lint) XXXXXXXXXXXXXXXXXXXXXXXXX; #endif #endif [/code] I want to delete line1, 2, 6. So, Could somebody tell me how to do it? thank you in advance!

Member Avatar for eggi
0
143
Member Avatar for number87

Maybe, you confused the functionality of Event struct and Node struct. There are two ways to reach you objective. First, [code] struct EventNode { tm startTime, endTime; string eventItem; string eventNotes; char allDay; EventNode* next; }; struct EventList { void addEvent(); ... // other member functions used to sustain the …

Member Avatar for number87
0
553
Member Avatar for shipeshipaca

Please see my comments below [QUOTE=shipeshipaca;680395] [ICODE]Book::Book(string Title,string AuthorLastName,string AuthorFirstName,string PublishingCompany,int SeriesNumber,int NumPages,int CopyrightYear,string Series): m_Title(Title), m_Series(Series), m_AuthorFirstName(AuthorFirstName), m_AuthorLastName(AuthorLastName), m_PublishingCompany(PublishingCompany), m_SeriesNumber(SeriesNumber), m_NumPages(NumPages), m_CopyrightYear(CopyrightYear) { fstream filehandle; string filename=m_Title+".txt"; char m_filename[80]; for(int i=0;i<filename.size();++i) { m_filename[i]=filename[i]; } [COLOR="Red"]//the c-style string should end with a '\0', //so add line m_filename[i] = '\0'; //define …

Member Avatar for littlestone
0
157
Member Avatar for henpecked1

I think you maybe misunderstand the meaning of index and size. There are some errors in your code, please see my comments below. I attached my code, which is base on yours. Please refer to it. [QUOTE=henpecked1;679639]How do you delete the front cell of an array in an array based …

Member Avatar for littlestone
0
153
Member Avatar for shamila08

Which container do you use to store the number? vector? list? if you use list, you can use the unique(op) function to eliminate the duplicate number. the op is a function or a functional object used to predicate whether two number is equivalent.

Member Avatar for shamila08
0
115
Member Avatar for littlestone

Question is : Write a function [code=c++] int f(char* str, long pattern) [/code] to find out how many pattern does the str contain? str is a char array consist of '1' and '0'; for example: str = "11010101110101011110100011001" ,pattern = 110; My solution is change pattern and str to std::string, …

Member Avatar for vijayan121
0
325
Member Avatar for imtnan

You can not pass a array to a function without the element number of each dimension. in the function, it will not know the number of the elements. 1. you can use struct to pass multidimensional array. for example: struct aaa { int value[10][20]; } int function (struct aaa& parameter) …

Member Avatar for dougy83
0
3K
Member Avatar for hezfast2

It wrong here: [code=c++] for (counter = 0; counter < 6; counter++) if(sellItem == itemName[counter]) [/code] if there are less than 6 item in itemName, it will occur memory error.

Member Avatar for littlestone
0
402
Member Avatar for Adrian99420

I am not sure I understand what you want. Maybe, the following code can help you. I write it using C++, you can translate it to C. This code can replace the text [icode]Set wallpaper="aaaa" [/icode] with [icode] Set wallpaper="text"[/icode] [code=C++] int main(int argc, char *argv[]) { string text = …

Member Avatar for Ancient Dragon
0
146
Member Avatar for littlestone

What will happen if caught exception when new a object? For example: [code=c++] ClassTest* ptr = 0; try { ptr = new ClassTest; } catch(...) { } [/code] if the constructor of ClassTest throw exception, what will happen? will ptr == 0 ? some memory leak?

Member Avatar for Narue
0
167
Member Avatar for mr.cool

[quote] for(x=0;x<5;x++); [/quote] delete the ';' at the end of this line

Member Avatar for mr.cool
0
102
Member Avatar for jennyebrooke

I have finished it, but to don't violate the rules of this website --"Don't give away code" , I can not give you all my source code. The following is the framework of program. hope it can help you. [code=c++] #include <iostream> #include <vector> using namespace std; struct Student { …

Member Avatar for littlestone
0
107
Member Avatar for bustedsfnewkia

[QUOTE] Are references less or more efficient than using pointers? [/quote] I think it's more efficient than using pointer. [quote] Also, if I were to call this function, would the second parameter be simple of type double? or would it be double*? [/QUOTE] just be double.

Member Avatar for littlestone
0
105
Member Avatar for scream2ice

I found two problem. 1. if you use the following code to open a file, the file must exist before running your program. [code] f1.open ("doc1.txt", ios::in | ios:: out); [/code] you can just use the default flag to open the file. 2. [code] str[i]=(str[i]=='C'|| str[i]=='c')? 'blue': 'c'; [/code] the …

Member Avatar for John A
0
100
Member Avatar for nurulshidanoni

Why you want to change vector<int> to float? Do you want to use the float total to store the sum of the exam codes? maybe you can add a member to your struct. like this: [code] struct exam { int examid; vector <int> examcodelist; float total; }; [/code] In addition, …

Member Avatar for littlestone
0
293
Member Avatar for VernonDozier

The various combinations of the flags and the corresponding meaning as below: [code] ios_base Flags Meaning in Reads (file must exist) out Empties and writes (creates if necessary) out | trunc Empties and writes (creates if necessary) out | app Appends (creates if necessary) in I out Reads and writes; …

Member Avatar for VernonDozier
0
214
Member Avatar for littlestone

For a singleton class, there is only one instance in a process, so it's not necessary to define a member function as static, am I right? Thanks in advance.

Member Avatar for dougy83
0
282
Member Avatar for Cosa

Do your address have space? cin can not read a string with space. maybe you should use getline to read the address.

Member Avatar for Cosa
0
285
Member Avatar for aminit
Member Avatar for littlestone

There are two way to define a character array constant: 1. const char* const OUT_STRING="hello world"; 2.const string OUT_STRING="hello world"; which one is better? why?

Member Avatar for vijayan121
0
61

The End.