Alejandro
You still can use it if it named in the definition
True, I was thinking on the case of definition and declaration in the same point
Sachin
#include <stdio.h> struct employee { char name[27]; char emp_code[20]; char DOB[11]; int salary; }; struct employee someemp; void details(someemp emp) { printf("Employee details is \n"); printf("Name: %s\n", emp.name) ; printf("DOB : %s\n", emp.DOB ) ; printf("EmpCode: %s\n", emp.emp_code); printf("Salary: %d", emp.salary) ; } int main(){ printf("Enter the Employee details :\n"); scanf("%s%s%s%d", someemp.name, someemp.DOB, someemp.emp_code, &someemp.salary) ; details(someemp); }
Sachin
plz remove the erroe
Alejandro
It may be interesting for some RAII class like a mutex that you won’t use in the function explicitly
Sachin
any one
Sachin
?
Talula
Sachin
What erroe?
||=== Build file: "no target" in "no project" (compiler: unknown) ===| C:\Users\DELL\Documents\C PROGM\new.c|14|error: expected declaration specifiers or '...' before 'someemp'| C:\Users\DELL\Documents\C PROGM\new.c||In function 'main':| C:\Users\DELL\Documents\C PROGM\new.c|29|warning: implicit declaration of function 'details' [-Wimplicit-function-declaration]| ||=== Build failed: 1 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|
Sachin
C:\Users\DELL\Documents\C PROGM\new.c|14|error: expected declaration specifiers or '...' before 'someemp'| this
Sachin
/
Sachin
ok
Sachin
no not working
klimi
Are you sure you ide / build tools are set properly?
Sachin
yes
Talula
no not working
What is your error now because it is working for me.
Sachin
ok
Sachin
wait
'''''''
#include <stdio.h> struct employee { char name[27]; char emp_code[20]; char DOB[11]; int salary; }; struct employee someemp; void details(someemp emp) { printf("Employee details is \n"); printf("Name: %s\n", emp.name) ; printf("DOB : %s\n", emp.DOB ) ; printf("EmpCode: %s\n", emp.emp_code); printf("Salary: %d", emp.salary) ; } int main(){ printf("Enter the Employee details :\n"); scanf("%s%s%s%d", someemp.name, someemp.DOB, someemp.emp_code, &someemp.salary) ; details(someemp); }
#include <stdio.h> struct employee { char name[27]; char emp_code[20]; char DOB[11]; int salary; }; struct employee someemp; void details(struct employee someemp) { printf("Employee details is \n"); printf("Name: %s\n", someemp.name) ; printf("DOB : %s\n", someemp.DOB ) ; printf("EmpCode: %s\n", someemp.emp_code); printf("Salary: %d", someemp.salary) ; } int main(){ printf("Enter the Employee details :\n"); scanf("%s%s%s%d", someemp.name, someemp.DOB, someemp.emp_code, &someemp.salary) ; details(someemp); }
'''''''
Check this out, it worked
'''''''
He first decide to store details of someemp, but then stored them as details of emp, and then he called details of someemp in the main function
م. سرى
hi can anyone help me for this question Write a program which find the accumulator average AC as below : AC=( sum i=1 ^ n x i * w i sum i=1 ^ n w i )
Saddam
Anyone have MCQ
klimi
Anyone have MCQ
Military Call to Quarters?
Saddam
Multiple choice questions
Saddam
For C programming
klimi
what does that mean? what do you want from us? questions?
Anonymous
/get
NISHA
Hi, can I know what's other best app I could install rather than Dev C++
NISHA
/get ide
IDE software?
NISHA
Good one.
levi
/get
der ðiβüśüɾę
/get ide
der ðiβüśüɾę
Ravi
Hi, can I know what's other best app I could install rather than Dev C++
For development purpose or simply writing programs?
Sivaprabu
/get cbook
Earl B
Didn't you understand the code implementation or how bubble sort works?
it took about an hour or so of looking at multiple examples of code but I ended up getting it, thanks for the reply
Anonymous
it took about an hour or so of looking at multiple examples of code but I ended up getting it, thanks for the reply
If you want, you can take a look at the interactive visualizations of various algorithms here.
Jayant
Hi someone can help me solve one coding problem?
Jayant
Count the number of non-empty subsets of an array such that the product of numbers in that subset is of the form P1*P2*......P3 where P1, P2,....., Pk are distinct prime numbers.
Jayant
Input - 2 3 2 6 12 4 4 5 6 15
Jayant
Output- 2 4
Ravi
Input - 2 3 2 6 12 4 4 5 6 15
array length contraints?
mito
I was reading about variable assignments and initializations in cpp. there was this one line -> "For more complicated types, direct initialization tends to be more efficient than copy initialization." What are those more complicated types and why is it more efficient ? any examples?
Kiss
Anyone has experience with virtual machines programming using VMWare? I have a problem related to TFTP open timeout and EPT(Extended paged tables)
Adarsh
Can anyone give me some idea how can i print n-bonacci series?
john
Can fseek be used in place of fopen in read mode
klimi
Can fseek be used in place of fopen in read mode
you still need to open the file first no?
john
Yes
Hamza
Anyone plzz help me
Hamza
I am doing project unable to resolve some errors
john
I can try
Issa N'golo
Hi everyone. What Should i learn betwean c and c++ ?
None
#define PI 3.14159 Main() { Int R, C Float perimeter Float area; C = PI R = 5; Perimeter = 2.0*C*R; Area = C*R*R; Printf(“%f” “%d”, &perimeter, &area) }
None
Hi everyone. What Should i learn betwean c and c++ ?
The program is your brain the computer is just a device... exercise your brain to think logically smarter than you'd imagine...
None
What could be the error in this program please... #define Basic_salary 20000 #define Bonus_rate 300 #define Commission 0.02 void main(){ int quantity; float gross_salary, price; float Bonus, commission; printf("Number of items sold and their prices \n"); scanf("%d %f", &quantity, &price); bonus= Bonus_rate*quantity; commission= Commission*quantity*price; gross_salary= Basic_salary+bonus+Commission; printf("\n"); printf("Bonus=%6.2f \n", bonus); printf("Commission=6.2f \n", commission); printf("gross_salary=%6.2f \n" gross_salary); return 0; }
None
It seems a newspaper. NOT readable. Errors can be in any part. For example your main is a void function and return an integer ⛔
Okay then it's still detecting an error... #define Basic_salary 20000 #define Bonus_rate 300 #define Commission 0.02 int main() { int quantity; float gross_salary, price; float Bonus, commission; printf("Number of items sold and their prices \n"); scanf("%d %f", &quantity, &price); bonus= Bonus_rate*quantity; commission= Commission*quantity*price; gross_salary= Basic_salary+bonus+Commission; printf("\n"); printf("Bonus=%6.2f \n", bonus); printf("Commission=6.2f \n", commission); printf("gross_salary=%6.2f \n" gross_salary); return 0 }
None
U realise hata hii yenye umeng'oa has an error
'''''''
Okay then it's still detecting an error... #define Basic_salary 20000 #define Bonus_rate 300 #define Commission 0.02 int main() { int quantity; float gross_salary, price; float Bonus, commission; printf("Number of items sold and their prices \n"); scanf("%d %f", &quantity, &price); bonus= Bonus_rate*quantity; commission= Commission*quantity*price; gross_salary= Basic_salary+bonus+Commission; printf("\n"); printf("Bonus=%6.2f \n", bonus); printf("Commission=6.2f \n", commission); printf("gross_salary=%6.2f \n" gross_salary); return 0 }
#include<stdio.h> #define Basic_salary 20000 #define Bonus_rate 300 #define Commission 0.02 int main() { int quantity; float gross_salary,price; float bonus, commission; printf("Number of items sold and their prices \n"); scanf("%d %f", &quantity, &price); bonus= Bonus_rate*quantity; commission= Commission*quantity*price; gross_salary= Basic_salary+bonus+Commission; printf("\n"); printf("Bonus=%6.2f \n", bonus); printf("Commission=%6.2f \n", commission); printf("gross_salary=%6.2f \n", gross_salary); return 0; }
None
So I only missed #include....?
'''''''
LVSMPJUN23-16
Hmm
数学の恋人
Hello, what's the difference between doing something like using Byte = std::uint8_t; vs typedef std::uint8_t Byte; as far as I know the prior one is just modern way of C++ and latter is old and C-like they are basically same things from outside
Azfar 😸
I saw a 4 hour full course video in youtube teaching people about C++ Is youtube a good startup for a beginner like me?
Azfar 😸
Or is there any other reliable source?
Anonymous
https://gist.github.com/mgood7123/06477b23692112d488b91d2462e64bb5 why isnt this keeping all the symbols in my .a archives ?