Anonymous
Ok
Anonymous
So now it makes much more sense. I have a feeling you don't even read what Im typing.
Anonymous
So basically, the problem is probably that you are passing a pointer to a TaskQueue object
Amu
So basically, the problem is probably that you are passing a pointer to a TaskQueue object
i see, so what does that mean and how does it cause a segmentation fault?
Anonymous
Because you are casting it to a Simulation object, which it's not.
Anonymous
I would suggest watching a tutorial for cpp from scratch
Amu
I would suggest watching a tutorial for cpp from scratch
yeah i wish i had that kind of time, anyways thanks for the info
Anonymous
Np
Saleh
#include <stdio.h> #include <string.h> void main() { char passwd[6], i ; printf("pls enter your password"); scanf("%s",passwd); printf("You have entered %s\n",passwd); encrpt(passwd); printf("Your password is encrpted: %s\n",passwd); // encrpt function for(i=0;passwd[i];i++){ passwd[i]=passwd[i]+3; } }
Saleh
hello i have been trying to write a function to encrpt a srting
Saleh
this is what i tried but its given me wrong
Anonymous
Where is the encrypt function?
Anonymous
encrpt *
Saleh
Where is the encrypt function?
char encrpt() { for(i=0;passwd[i];i++){ passwd[i]=passwd[]+3; }
Saleh
This
Anonymous
Show us the error
Anonymous
char encrpt() { for(i=0;passwd[i];i++){ passwd[i]=passwd[]+3; }
And you return here a character, which is probably not what u want
Anonymous
Also you don't close the function, but I guess u just copied it wrong
Anonymous
I mean, the text.
404
Ht
Anonymous
Oh and u don't return anything and don't pass anything haha. I would suggest learning the language first
Anonymous
Don't ask questions if u don't know the language, it's pointless.
Saleh
OK thank you
Anonymous
OK thank you
No problem. Goodluck
Saleh
😂
Lol don't laugh at me, it's few days of learning and our teacher give us this task.
Saleh
To catch up with this please, can you suggest some areas to learn?
Anonymous
Thanks
Luca
hello guys, I've several c/cpp file compiled with a Makefile. Each one of this file contain an int main function, I would like to create a new file to call several of this c/cpp file, so my question is: How can I invoke the main of another c/cpp file from the current one? Should I create a new process right? The problem is that I've tried to change the main method of Foo.c with just a simple function but i'm getting compile error when I use "make" again, I've tried to change Makefile but with no solution
Vikie
What do you mean?
To update my software
Alessandro
You can if you change the makefile to compile them separately
Alessandro
If you compile them toghether you cant have more then one function with the same name unless you declare it as static
Anonymous
Hey hi I am wondering for best DSA course and book 📚. Can you tell me? Thanks.
Anonymous
CLSR
Do you know best resources regarding DSA?
Anonymous
Do you know best resources regarding DSA?
geeksforgeeks, YouTube and self practice
Anton
Hi, please advise how to convert uint8_t* to std::string properly. I was using std::string str=std::string((char*)uint8_t_data) but somehow it stopped working (I don't know exact reason - this method works locally in EXE, but stopped working remotely in DLL).
juabove
I requested for a course and the bot warned me.is it wrong to request?
klimi
I requested for a course and the bot warned me.is it wrong to request?
You requested what? I am not understanding you?
klimi
Did you mean
klimi
#cs50
Krishnaa
#include<stdio.h> int main() { int n; scanf("%d",&n); int price[n]; char item[n]; for(int i=0; i<n; i++){ scanf("%c,%d",&item[i],&price[i]); } return 0; }
Krishnaa
#include<stdio.h> int main() { int n; scanf("%d",&n); int price[n]; char item[n]; for(int i=0; i<n; i++){ scanf("%c,%d",&item[i],&price[i]); } return 0; }
I give n as input and try to give n input values but it takes less than n values and exits the cod. Why??? Anyone help me with this please
Antonio
Can someone tell me what this means please: error: expected identifier or "(" before "(" token
Antonio
I’m just starting up I actually suck at this
Antonio
send your code first please
#include <stdio.h> #include <string.h> struct compito { char materia [20]; int ora; }; typedef struct compito Compito; void main(); { Compito uno strcpy (uno.materia "matematica"); uno.ora=1; Compito due strcpy (due.materia "italiano"); due.ora=2; printf ("Compito di: %s, Ora: %d\n", uno.materia, uno.ora); printf ("Compito di: %s, Ora: %d\n", due.materia, due.ora); }
Antonio
12
Antonio
The { right after void main ()
artemetra 🇺🇦
The { right after void main ()
you shouldn't put a semicolon after function signatures in definitions
artemetra 🇺🇦
it should be void main() { ...
artemetra 🇺🇦
also put a semicolon where you define uno and due
artemetra 🇺🇦
also you forgot a comma in both strcpys
artemetra 🇺🇦
it should be strcpy (uno.materia, "matematica"); and the same for italiano
Antonio
Thanks mate it worked , I really appreciate that
artemetra 🇺🇦
np :')
juabove
I requested for social media marketing course. And the bot gave me warning
juabove
Digital marketing
Dumb
Do I need to use any t?
You write it, you know it
Dumb
You used 3 variables while you were "scanning" only two
Krishnaa
But still
Krishnaa
now have a look at it, that’s what I mean
Dumb
scanf("%c %d",&item[i],&price[i]);
Dumb
it's the correct line
Krishnaa
Like scanf(“(%d+%d)”, &a,&b);
Krishnaa
This works fine for an input: (2+5)
Dumb
mh you're right, my bad
Dumb
lemme think a moment about the code i'm testing it
Dumb
This works fine for an input: (2+5)
I saw something interesting