User Profile
Collapse
Profile Sidebar
Collapse
Jeevan83
Last Activity: Sep 7 '14, 10:10 AM
Joined: Aug 6 '14
Location:
-
Hi bro, here NOOFITEM is a macro and will be replaced by 12, sorry I didnt post it! If its 12 then it's an array right? -
How to run time initialize array of structures
Hi, guys, I somewhere read "You cannot initialize a structure like that at run time."
example:
...Code:struct item_info { char itemname[15]; int quantity; float retail; float wholesale; }item[NOOFITEM]; int main() { item[0]={"rice",10,40,30}; item[1]={"sugar",10,40,30}; item[2]={"soap",10,40,30}; -
unable to delete a node in double linked list
I am trying this without a head/start pointer which would generally hold the address of first node. I have 3 nodes here from which I am trying to delete last node, but its not happening. I might be wrong in my logic and this is my first linked list program, so please help me!
...Code:#include <stdio.h> #include <stdlib.h> struct dll{ struct dll *prev; int data; -
Hey thanks man but can i replace while with if? I replaced and getting output but i get a weird character at the end after jeevan like jeevan? .. Am I doing any other mistake here?Leave a comment:
-
No output for own implementation of strcpy in c
Hi, guys trying to implement own strcpy function, but no output is being printed. Please help
...Code:#include<stdio.h> #include<string.h> void strcpy_own(char dest[], char src[], int len); int main() { char src[15]="jeevan", dest[15]; int length=0; length = strlen(src)+1; strcpy_own(dest,src,length); return 0; } -
expected expression before ‘{’ token
Hi, I gott his error after compiling. I could not find the error, whats the error please?
error:
error: expected expression before ‘{’ token
item[0]={"rice",10,40, 30};
...Code:#include<stdio.h> #include<stdlib.h> #define ITEMLIMIT 7 #define NOOFITEM 3 struct item_info { char itemname[15]; int quantity; float retail; -
Thanks bt somehow I solved it yesterday night and did samething like you! :)Leave a comment:
-
Calling main menu is displaying sub menu
i am doing an airplain seat booking system. Here I have a main menu of chooseflight() and submenu of printmenu(). Whenever I press 'f' from printmenu's options I should return to mainmenu. But I cannot. Please help me!
...Code:int main() { chooseflight(); fflush(stdin); return 0; } void chooseflight(void) { char selectflight; printf("a) Flight -
How to estimate the sizeof(ptr) and izeof(*ptr)
#include <stdio.h>
int main()
{
int arr[2][2];
int *p[2];
int (*p1)[2];
p[2]=arr[2];
p1=&arr[2];
printf("size of p is %d\t, *p is %d\n",sizeof(p) ,sizeof(*p));
printf("size of p1 is %d\t, *p1 is %d\n",sizeof(p1 ),sizeof(*p1));
}
Output:
size of p is 8 , *p is 4
size of p1 is 4 , *p1 is 8
Please tell me how to actually relate...
No activity results to display
Show More
Leave a comment: