Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~6K People Reached
PC Specs
IBM-LENOVO Z50-70
Favorite Forums
Favorite Tags
c x 5
Member Avatar for Vahid_1

Hello, I'm just started to study malloc and realloc, so i just wrote this program to copy two string from user input and consenterate them. then ofcource print it. #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char *str = malloc(3) gets(str); int sl = strlen(str); str = realloc(str, …

Member Avatar for sepp2k
0
217
Member Avatar for Vahid_1

Hi, Let's say I have an array of 10 elements. I want user to enter 9 numbers so that they fill arrays 0 to 8 (9 numbers). Now I shift the arrays +1. so array[0] is now array[1] and so on. Now I ask user to enter 10th number (fills …

Member Avatar for Vahid_1
0
5K
Member Avatar for Vahid_1

Hi, This two parts of code both are intended to do one thing. get two numbers from user, calculate sum between them. print it. now only the first code is working properly. second one is faulty. but why? what's the problem? code no1: #include <stdio.h> int main() { int n, …

Member Avatar for jnneson
0
85