-
i have a situation where i need to use variable of structure in different files. Where we will assign function returned value and use that assigned value as a arguments in some other functions of different files. please guide me with example how to go about on this situation.0
-
Member • May 23, 2013
use interfaceAre you sure? This action cannot be undone. -
Member • May 23, 2013
hello nayan please elaborate the interface . I am totally blank what you are talking about. What kind of interface we are talking here.Nayan Goenkause interfaceAre you sure? This action cannot be undone. -
Member • May 23, 2013
There is a concept in Java about interfaces. Where you can mass declare the functions in one object and use them in others. For detailed information Google it.Are you sure? This action cannot be undone. -
Member • May 24, 2013
dude i am a clean C programmer have no idea about java. Do you have any idea in C.Nayan GoenkaThere is a concept in Java about interfaces. Where you can mass declare the functions in one object and use them in others. For detailed information Google it.Are you sure? This action cannot be undone. -
Member • May 24, 2013
For that, one easy way would be to include the files u need to use it in other files😀. For example u want to use the values from file a.c inside file b.c, so inside b.c just write:Pushpendra2911i have a situation where i need to use variable of structure in different files. Where we will assign function returned value and use that assigned value as a arguments in some other functions of different files. please guide me with example how to go about on this situation.
#include"a.c"
Although this is not an efficient method, but it will work😁 .
Good Luck , any doubts are welcomed👍 .Are you sure? This action cannot be undone. -
Member • May 24, 2013
thanks rahul for your reply.
but in my project i have whole library and i want to use value of one particular variable in several different file. your solution will be bit complicated.Are you sure? This action cannot be undone. -
Member • May 26, 2013
Pushpendra2911thanks rahul for your reply.
but in my project i have whole library and i want to use value of one particular variable in several different file. your solution will be bit complicated.
Create project. In dev or visual IDE you have an option of creating Projects.
Include all your supporting programs in this project and in your main program, include the other files.
ex:
your project has main.cpp and sol.cpp where main.cpp is your main file.. then in main.cpp add a line
#include "sol.cpp"
As far as I know, this concept works on object oriented programming languages like C++ n java etc.
C is structural so not sure whether this will workAre you sure? This action cannot be undone. -
Member • May 26, 2013
well thanx for your reply vishalVishal0203Create project. In dev or visual IDE you have an option of creating Projects.
Include all your supporting programs in this project and in your main program, include the other files.
ex:
your project has main.cpp and sol.cpp where main.cpp is your main file.. then in main.cpp add a line
#include "sol.cpp"
As far as I know, this concept works on object oriented programming languages like C++ n java etc.
C is structural so not sure whether this will work
i have theory knowledge on oops but never worked on any project.
currently i am using linux opensuse and my IDE is netbeans 7 in which i am using C project included all library and files.
good news is i have found the solution and now my code is running in live server.
solution is extern keyword.Are you sure? This action cannot be undone. -
Member • May 30, 2013
i'd like to see a example code!Are you sure? This action cannot be undone. -
Member • May 30, 2013
my code is little complicated in order to share.Vishal0203i'd like to see a example code!
so go through the below procedure and reply me if you succeed.
suppose we have three .c files say 10th.c, 12th.c and main.c
now do some marks calculation for 10th and 12th subjects using structure and functions in two different .c file i.e 10th.c and 12th.c
now in main.h declare
extern int passing_mark;
in main.c define it as
int passing_mark = 35;
now in include main.h in all .c files.
and just declare int passing_mark in 10th.c and 12th.c
our work is done.
now we can use the value of passing_mark in all .c files where main.h is included.
even modification in our variable will be updated and can be used according to requirements.
update me with any issue.Are you sure? This action cannot be undone. -
Member • Jun 21, 2013
hello pushpendra...mself aman...need to talk to you...regardng cdac ccat....can i get ur contact no. or email id????? mine is <Email ID Clipped By MOD>Pushpendra2911my code is little complicated in order to share.
so go through the below procedure and reply me if you succeed.
suppose we have three .c files say 10th.c, 12th.c and main.c
now do some marks calculation for 10th and 12th subjects using structure and functions in two different .c file i.e 10th.c and 12th.c
now in main.h declare
extern int passing_mark;
in main.c define it as
int passing_mark = 35;
now in include main.h in all .c files.
and just declare int passing_mark in 10th.c and 12th.c
our work is done.
now we can use the value of passing_mark in all .c files where main.h is included.
even modification in our variable will be updated and can be used according to requirements.
update me with any issue.Are you sure? This action cannot be undone. -
Member • Jun 21, 2013
yes buddy what ever you want to discuss. discuss it here i might not able to response you back from my gmail because of firewall in our office and i cant communicate with you through my official email id. what ever you have in your mind shoot it here i will reply as soon as possible.aman123hello pushpendra...mself aman...need to talk to you...regardng cdac ccat....can i get ur contact no. or email id????? mine is #-Link-Snipped-#Are you sure? This action cannot be undone. -
Member • Jun 21, 2013
heyy,,,,, thnx buddy for ur response... i am appearing for c-cat 2013 aug...want to knw abt test... i knw d subjs... but something abt tpcs in sec-b and sec-a...meaning level of test and mostly which topics come under...sec a( ques type f verbal, quant,,reasonig) n sec b tooo.... mean there is no previous yr ques papaer on ne.....as i have to anyhow get into the course in good institute....pls help me...Pushpendra2911yes buddy what ever you want to discuss. discuss it here i might not able to response you back from my gmail because of firewall in our office and i cant communicate with you through my official email id. what ever you have in your mind shoot it here i will reply as soon as possible.Are you sure? This action cannot be undone. -
Member • Jun 21, 2013
heyy, as i have left with only 15 days so can u help me abt tpcs which should i concntrate more f sec a n bPushpendra2911yes buddy what ever you want to discuss. discuss it here i might not able to response you back from my gmail because of firewall in our office and i cant communicate with you through my official email id. what ever you have in your mind shoot it here i will reply as soon as possible.Are you sure? This action cannot be undone. -
Member • Jun 23, 2013
hey friend we cannot predict what might come.aman123heyy, as i have left with only 15 days so can u help me abt tpcs which should i concntrate more f sec a n b
you need to cover all syllabus topics with there formulae and procedure.
i can suggest you some topics
boats and stream
probability mostly question with card deck and bags with colored balls
number series i.e A.P, G.P, H.P.
speed distance and time.
clock calender and blood realation
we faced these type of questions at our time with some general english.
dont worry, section A is pretty easy
worry about sec B and C which will improve ur rank.
all the best prepare hard.Are you sure? This action cannot be undone. -
Member • Jun 23, 2013
well where are you?aman123heyy, as i have left with only 15 days so can u help me abt tpcs which should i concntrate more f sec a n b
if u are at pune u have a good option for preparation.
from sunbeam you can go predac they provide class preparation for the same.
u can go for it.
they cover preparation of all sections.
well you can do it by your own.
i did it because i was not aware of such type of preparation course.
decision is ur .
prepare well all the best.Are you sure? This action cannot be undone. -
Member • Jun 23, 2013
thnx..bro..i am in ambala city(near chd.) i am preparing myself only...little bit worried abt admsn....notng else.Pushpendra2911well where are you?
if u are at pune u have a good option for preparation.
from sunbeam you can go predac they provide class preparation for the same.
u can go for it.
they cover preparation of all sections.
well you can do it by your own.
i did it because i was not aware of such type of preparation course.
decision is ur .
prepare well all the best.Are you sure? This action cannot be undone. -
Member • Jul 15, 2013
hello bro...thnx fr ur guidance for c-cat. i have got 36 rank in c-cat... and i will surely get acts pune...but want to knw about its placement for dac course...is it good??? what r chances....Pushpendra2911well where are you?
if u are at pune u have a good option for preparation.
from sunbeam you can go predac they provide class preparation for the same.
u can go for it.
they cover preparation of all sections.
well you can do it by your own.
i did it because i was not aware of such type of preparation course.
decision is ur .
prepare well all the best.Are you sure? This action cannot be undone.