16,009,114 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Mwater07 (Top 6 by date)
Mwater07
20-Sep-17 13:14pm
View
Thank you. I have done the changes that you have suggested on the code, it works fine. But as you have stated, during initialization row and col arrays on generate_row_and_col function , I only initialize indexes with non zero elements, rest of them are not initialized. This is not causing any error in this program, but in terms of good programming practice,those indexes with 0 values are not initiated and the arrays will look like(garbage, garbage,7, garbage, 5, garbage, garbage....). Can we just limit the generate_row_and_col function, so We can only store non zero value indexes.
Thank you
Mwater07
20-Sep-17 9:05am
View
Deleted
I need to write a C++ program that compute the dot product of two given vectors. In these programs, in vectors A and B only nonzero elements are stored. Use array of structures to store non-zero elements.
int product=0; for (int i=0; i<=n; i++) product+=A[i]*B[i]
The following is an example:
Input n: 10
Enter nonzero elements in A
Index val
2 7
4 5
7 8
9 4
Enter nonzero elements in B
Index val
3 5
4 6
9 5
Mwater07
20-Sep-17 9:03am
View
Deleted
I need to write a C++ program that compute the dot product of two given vectors. In these programs, in vectors A and B only nonzero elements are stored. Use array of structures to store non-zero elements.
int product=0; for (int i=0; i<=n; i++) product+=A[i]*B[i]
The following is an example:
Input n: 10
Enter nonzero elements in A
Index val
2 7
4 5
7 8
9 4
Enter nonzero elements in B
Index val
3 5
4 6
9 5
Mwater07
16-Mar-17 13:39pm
View
Yes, it worked.
Thank you
Mwater07
16-Mar-17 13:38pm
View
What kind of debugger would you recommend?
Mwater07
16-Mar-17 13:25pm
View
it is due to inc function implemantation. It is called on line#110 twice
Show More