15,789,360 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 Python questions
View PHP 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 Member 12919791 (Top 9 by date)
Member 12919791
11-Jan-17 20:15pm
View
Exact instructions link:
http://cdn.cs50.net/2016/x/psets/6/pset6/pset6.html#parse
Member 12919791
2-Jan-17 15:55pm
View
With &buffer it gives the same error.
Am I supposed to use malloc()?
Thanks a lot,
Member 12919791
2-Jan-17 15:03pm
View
Yes, the changes are made to other freads
Member 12919791
2-Jan-17 11:41am
View
I understand the mistake above, but the same error comes even after I changed that line.
Member 12919791
29-Dec-16 18:30pm
View
Ok, thank you.
Member 12919791
29-Dec-16 18:20pm
View
If d - dimension is odd, then the order of the last 2 numbers should be: 1 2.
If d is even, the order of the last 2 numbers should be: 2 1.
The mistake in my output is when those 2 numbers get printed in the wrong order with d as even. In the above example, my output for d as 4 gives the last 2 numbers as 2 1 instead of 1 2.
Thanks,
Member 12919791
28-Dec-16 12:55pm
View
Yes I didn't remember that.
I now changed the code at the beginning to consider if (n <= 0).
Yet the same error comes.
Thanks a lot,
Member 12919791
27-Dec-16 15:26pm
View
Just if curious, my code:
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main(void)
{
int height;
int i;
int spaces1;
int blocks1;
int spaces2;
int blocks2;
do
{
printf("Height: ");
height = GetInt();
if (height==0)
{
return 0;
}
}
while
(height < 0 || height > 23);
if (height == 1)
{
for (i=0; i<1;i++)
{
for (blocks1 = 0; blocks1 < 1; blocks1++)
{
printf("#");
}
printf(" ");
for (blocks2 = 0; blocks2 < 1; blocks2++)
{
printf("#");
}
printf("\n");
}
}
else
{
for (int a=1; a<height +1; a++)
{
for(spaces1 = 0; spaces1 < height-a; spaces1++)
{
printf(" ");
}
for (blocks1 = 0; blocks1 < a; blocks1++)
{
printf("#");
}
printf(" ");
for (blocks2 = 0; blocks2 < a; blocks2++)
{
printf("#");
}
for(spaces2 = 0; spaces2 < height - a; spaces2++)
{
printf(" ");
}
printf("\n");
}
}
}
Member 12919791
23-Dec-16 20:29pm
View
I tried adding long long for NUM, but that didn't help. GetLongLong() is supposed to be a built-in function. Thanks,
Show More