15,886,857 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 Python 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 Parth Vijay (Top 8 by date)
Parth Vijay
27-Nov-22 0:15am
View
Thanks Sir, I made changes in my own code now its working fine!
Changes Made(in my code):
-------------
n = n*n;
n n n%MOD; (change)
x = x/2;
-------------
res = res*n;
res = res % MOD;
x--;
------------
after all changes no need for this line(before the return res;):
res = res%MOD;
------------
Will read more about this<>
Parth Vijay
3-Nov-22 20:19pm
View
ok, i got the mistake and got the correct answer..
Parth Vijay
8-Oct-22 6:03am
View
So, i came to point where i find that fgets is much better than scanf..
Bcoz fgets takes '\n' in its string when we press enter which we can remove by making a function something like u have made and on the other side scanf stops taking an input when it encounters an enter key and the pressed enter key is left in the buffer which will create a problem for the upcoming input function (scanf,fgets,gets etc). So, to remove this problem what i did i just found the definition of the scanf fucntion in the (stdio.h) file by the help of debugger(step in feature) and added this fflush(stdin) before returning anything...
And i run the program it is working and i dont have to care now where to add this fflush(stdin) statement..
i want to ask if this is correct approach. means like changing the original code will affect me in future?
Parth Vijay
3-Oct-22 6:56am
View
Yes sir, The first need was to know the mistake in my own code then moving on to some other ideas..
Parth Vijay
3-Oct-22 6:50am
View
thank you, for the additional functions now get to know them.. But, i'm using them because i have encountered this situation for the very first time.. So, my approach is learn how their codes are written.. If i don't write them i will never understand how they works (what are logics used to write that fucntion).. In near future i will use these shortcuts to save time;..thnaks again
Parth Vijay
3-Oct-22 3:37am
View
ok got it...:)
Parth Vijay
3-Oct-22 3:34am
View
thanks sir, i was not aware of this debug feature in the IDE as I'm an absolute beginner. But after your answer i have learnt it from some utube tutorials and found that there were many mistakes in the code.. Next time, I will first dry run by hands and then if not contented will use this feature..
Parth Vijay
2-Oct-22 23:31pm
View
You have used basepointer so that we don't have to free the item pointer again and again?
and one more thing Is it valid to free the basepointer before making item pointer free?
Although, thanks for the solution.
Show More