Anonymous
U repeat the same error
if you compile it , you will see the I option works for the first question but S does not work
Anonymous
Hey
Anonymous
I have a question
Anonymous
Ajay
Hlo
Ajay
I am human
Ajay
I have read
Ajay
/i am new here
Ajay
And i want to learn programming
Anonymous
yup
Ajay
Gnta
Anonymous
Gnta
If you look at the pinned message they offer some resources
Ajay
Okk
Ilya
if i need to use a typedef for function pointers, and i have my program split into different files, like a header file with your structures,unions, enums, and function declarations, a main doc with you main function , and a function c file, that defines functions, where would i put the typedef function pointers
There is no struct rules on this, at all. You can put anything anywhere. You only should remember not to break ODR. Usually a good first approach is to write declarations and data structure definitions in header files and code in source files
Ilya
#include <stdio.h> #include "functions.h" #include <stdlib.h> #include <string.h> void clearScreen(void){ printf("\033[H\033[J"); } StringorInt Initial_Questions(void){ StartOverMyG : ; clearScreen(); char stringOrIntegarArrayChoice; puts("Do you want to create a String or an Integer Array?"); puts("Type I for an Integer Array or S for string Array"); scanf("%c", &stringOrIntegarArrayChoice); switch(stringOrIntegarArrayChoice){ case 'I': return INTEGAR; break; case 'S': return STRING; break; default: goto StartOverMyG; } } ArrayData choose_Array_Member_Amount(InitialQuestionP Choose){ StartOverMyG : ; clearScreen(); int ArrayMemberTotal; int choice = Choose(); switch(choice){ case INTEGAR: puts("How many members do you need in your Integer Array?"); break; case STRING: puts("How many members do you need in your String Array?"); default: goto StartOverMyG; } scanf("%i", &ArrayMemberTotal); if(choice == INTEGAR){ puts("longlong"); } else if(choice == STRING){ puts("ldl life"); } ArrayData Array_Data; Array_Data.ArrayMemberTotal = ArrayMemberTotal; Array_Data.StringorInt = choice; return Array_Data; } void create_Array(ArrayMemberTotalP Data){ StartOverMyG : ; ArrayData ArrayCreator = Data(Initial_Questions); switch(ArrayCreator.StringorInt){ case INTEGAR: puts("i am Int"); break; case STRING: puts("I am Groot"); break; default: goto StartOverMyG; } } functions.c file
Daniel you'd better have used pastebin.com
SAM
Hi
Anonymous
Hello
Anonymous
Hi
klimi
Hi
Hi
Anonymous
Hello everyone
Anonymous
My name is vishnuvaradan .... Im from malaysia.... And im learning to do programming .... For web dev .... That my bio 😁
Anonymous
Hi
Anonymous
I have opencv installed in /usr/local, but the original version is installed in /usr/, How do I force cmake to find the header and lins in /usr/local?
Anonymous
The one under /usr/local is with opencv-contrib modules.
rex
int main() { char disp[3][5] = { {'d', 'f', 'd'}, {'a', 'b', 'c', 'd'}, {'d','f','d','e','r'} }; int j,count=0; for( int i=0;i<3;j++) { while(disp[i][j]!='\0') { j++; count++; } if(count>2) printf("%s",disp[i]); } return 0; }
rex
why this shows me core dumped
rex
ok
Anonymous
you increment j in the for loop not i and don't initialize j to 0
Bobo
Hello guys
Bobo
Please i need help How is a pointer used in a switch statement in C
klimi
hello bobo
Bobo
?
Bobo
hello bobo
I created this pointer *password And I want to pass it as argument on the switch statement
Bobo
I created this pointer *password And I want to pass it as argument on the switch statement
To compare it with a string to see if the password is correct
klimi
Huh?
why reply with such response to my hello :<
Anonymous
why this shows me core dumped
Because you fucked up There no '\0' in your array => you got out of range in your array
Bobo
Yom
Needed
klimi
😁. Sorry I just needed help
I am not a programmer
Bobo
What are you then?
...
a snow tiger
Bobo
Needed
Still do, so mistake there I need help
Bobo
a snow tiger
I see 👀 😄
rex
okk
Bobo
😂
Yom
He looks delicious
klimi
Bobo
Bobo
...
this doesnt work like this, switches only work on integral values
qwert
password = calloc(10,sizeof(double)); <—- smart enough
Bobo
klimi
qwert
use if
...
switch cases internally sorta use a lookup table to determine the pointer to jump to
...
Bobo
this doesnt work like this, switches only work on integral values
Okay, So I must use only the nested if loop there
...
if loop?
Bobo
if loop?
If Statement
qwert
if you are pleased with O(N), you cann array and compare in loop
Bobo
Thanks