Anonymous
Clrscr() doesnt work anymore use system("cls") instead it is in windows.h headerfile
novice
error: invalid operands to binary expression ('float' and 'int')
if (grid%2 == 0)
~~~~^~
1 error generated.
novice
this is what compiler saying
novice
why 0.0f ? pls explain me
novice
let me try first
novice
its showing same error
novice
novice
ok
novice
no change
Anonymous
no change
Make grid int instead of float
novice
float
novice
Anonymous
Modulas works with integers
novice
oh , wait
Anonymous
novice
no bro it's showing same error
novice
novice
i tried it bro
Anonymous
Anonymous
Modulas % returns remainder which is always an int not floating point number
novice
novice
(int)grind%2
Anonymous
U can but its easier to just use int.i mean its just a grid , it doesnt have a lot of activities going on. But u can do it 4 practice
Anonymous
#include<stdio.h>
void main(){
int list[5][5];
int i,j,x,y,max=0;
for(i=0;i<5;i++){
for(j=0;j<5;j++){
printf("Enter element:");
scanf("%d",&list[i][j]);
if(list[i][j]>max){
max=list[i][j];
x=i;
y=j;
}
}
}
printf("Max:%d \nlocation:[%d][%d]",max,x,y);
}
Mr.
Hello folks, I'm with the fallowing error using clang++ compiler, but in the g++ this doesn't happen:
#include <iostream>
void arr(char* C)
{
while (*C != '\0')
{
printf("%d-", &C);
printf("%c", *C);
C++;
}
printf("\n");
}
int main()
{
char C[20] = "Hello";
arr(C);
}
Mr.
This is my algorithm, and the error that occurs using clang is:
clang++ .\pointers.cpp
.\pointers.cpp:7:19: warning: format specifies type 'int' but the argument has type 'char **' [-Wformat]
printf("%d-", &C);
~~ ^~
Mr.
Any suggestion about why this occurs?
Mr.
*In g++ compiler the program works fine*
Ludovic 'Archivist'
Mr.
Yap, that's works. But now I realize that sometimes is important to do not avoid this warnings. Tks for the tips
Tazin
Subhash Suthar
brother can i get study material on c language
Go D.
Gcc not recognised
Mr.
Gcc not recognised
What the messege alerts? Appear something when you type gcc —version on cmd?
Go D.
Wait a min. I start my pc
Go D.
Cmd says all rights reserved
Go D.
Vs code says the term gcc is not recognised as the name of a cmdlet, function or operable program
Go D.
And #include<stdion.h> it is error
Mr.
Hmm okey, so in this situation you need to configure your WORKSPACE, to do the vscode recognize the compiler path and libraries.
Mr.
I recommend that you download the extentions of c/c++ in vscode
Go D.
I did
Mr.
Press ctrl+shift+p in the tab of your project, after this, select the C/C++ Edit Settings (JSON) and put the right configs to your compiler path and libraries
Mr.
You can find more about workspace configuration here: https://code.visualstudio.com/docs/getstarted/settings
But I think that following what I say probably will resolve your problem
Go D.
Thank you
Ludovic 'Archivist'
Ludovic 'Archivist'
The & means you intent to run a program and not a Powershell command
Go D.
Lemme try
Go D.
I think i could not install compiler correctly
Ludovic 'Archivist'
I think i could not install compiler correctly
Find the folder where the toolchain is installed and look for a folder named "bin", copy the full path of this folder, and add it to your "PATH" environment variable (Google it, it is not very hard)
Prinzkyd
hey
Anyone with an idea of how to reverse an array?
Prinzkyd
Unknown man
Can someone help me with hcf program i get confuse with it
Kaashᅠ
Unknown man
I am confusing in logic if we take 5 and 10 what will be hcf
Dark_🗿_
Hi guys
Dark_🗿_
I'm new to this field
Dark_🗿_
I needed to know abt some basics abt this lang tht could help me
Can u please help me out 🙏🙏
Rifa
Amaregouda
static variables are initialises at only once means!??
Amaregouda
please explain this
Amaregouda
u mean i canot assign new value to static variables??
Rifa
Initialized is assignment a value when variable declaring
Rifa
Rifa
English is hard v:
Anonymous
no
Amaregouda
i am confised please help
Rifa
Just share the code
Amaregouda
MODIFIED QUESTION
i declared a static variable inside a function with value 0, then added 1 to variable as count+=1. then print this function in main function twice. it produces the value 1 at first call, second call produce 2. then i reinitialise the variable with value 10 and print. its output is 10.
Rifa
Amaregouda
i am not permitted to share media in this group
Anonymous
Emre Atakuru