coal
also what i love about C is that there's also embedded languages like Lua, so you can use them to interface with your robot which is amazing
coal
Anonymous
coal
what kind of asm
4hk
hey, I want to use the class "Student" inside class "Class", but it wont let me this way: https://pastebin.com/iAAnqLQC , pero cuando pongo la clase "Estudiante" primero que la clase "Clase", no pasa este error, debería ser así?
Anonymous
Am having better understanding with low level language moving towards the high level ones "bottom up approach
coal
there's other way to do that, you can make a namespace and declare your class within it
coal
then you can access your class like "Estudiante::Clase", "Estudiante" being the namespace
coal
oh wait i actually misread your question
4hk
my english is gone, ty
coal
lo que pasa es que you're trying to look for a class which is not declared "yet"
\Device\NUL
Remember guys, Only english language is allowed
coal
remember that the code is read from top to bottom
coal
remember that the code is read from top to bottom
when the compiler arrives at your "Class" class, it realizes you're trying to use a "Estudiante" class which is not declared yet
the compiler doesnt know you're gonna declare it later so it breaks
4hk
I didd it, thank you :)
Anonymous
#include<stdio.h>
#include<stdlib.h>
#include<strings.h>
int main()
{
char name[128];
printf("Type your name: ");
scanf("%s",& name);
if(strcmp(name,"Bob\0")==0 || strcmp(name,"Alice\0")==0
printf("Best wishes and greetings %s\n", name);
return 0;
}
Anonymous
is this correct?
klimi
is this correct?
test.c: In function ‘main’:
test.c:10:8: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration]
10 | if(strcmp(name,"Bob\0")==0 || strcmp(name,"Alice\0")==0
| ^~~~~~
test.c:4:1: note: include ‘<string.h>’ or provide a declaration of ‘strcmp’
3 | #include<strings.h>
+++ |+#include <string.h>
4 |
test.c:10:60: error: expected ‘)’ before ‘printf’
10 | if(strcmp(name,"Bob\0")==0 || strcmp(name,"Alice\0")==0
| ~ ^
| )
11 | printf("Best wishes and greetings %s\n", name);
| ~~~~~~
test.c:13:1: error: expected expression before ‘}’ token
13 | }
| ^
Anonymous
is it correct then?
\Device\NUL
is it correct then?
Why you type \0 in the string
"str" is equal to 's' 't' 'r' '\0'
coal
Anonymous
please correct it
coal
is it correct then?
it has a syntax error, and "strings.h" is probably "string.h"
coal
please correct it
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char name[128];
printf("Type your name: ");
scanf("%s",& name);
if(strcmp(name,"Bob\0")==0 || strcmp(name,"Alice\0")==0)
printf("Best wishes and greetings %s\n", name);
return 0;
}
Anonymous
oh than you
coal
yw
Anonymous
you're right
coal
yay
klimi
i feel like this was just some sort of homework...
Alex
Hello there!
Could someone help me in solving my problem, it lies in the fact that I cannot display two words, the last letter of which is the same.
I found this case, and I display the letter that matches, but I don’t know how to display these two words.
Prince Fine
hey guys how can i count the occurence of a letter in a given word ?
Golden Age Of
Golden Age Of
Anonymous
Hi
Anonymous
What is the uses of "extern c;" in a code
Anonymous
And in which function we will run it
Anonymous
Prince Fine
Anonymous
So , why we used "func()" in our code lol?
Anonymous
Anonymous
Golden Age Of
What's the main definition of itM
?
For example you have a big global object in some file(not the most common example, butc just imagine) and you need this one in another file
But, to create this object, imagine, we need 3 seconds.
So, we don't want to create one more such object and waste 6 seconds except of 3 one time
So, there it goes.
In the file we want to use this big object we say to compiler
extern BIG_OBJECT;
This way compiler won't create one more object for your file, it will try to find it somewhere.
Anonymous
Golden Age Of
If I'm missed, experts, please, let me know and say what's wrong
Golden Age Of
coal
coal
coal
coal
apart from disabling name mangling
coal
what does it do
Anonymous
Yes?
coal
labyrinth
I found some headers would, under a certain namespace, declare a class like class Foo; which is defined and implemented in a separate .h and .cc file; what is the purpose of this line?
Pavel
pyMorgado
hi,
why the message "the project does not know how to run the profile" of my application?... in visual studio, when running the debugger
Compiler🇮🇷
Hi
Compiler🇮🇷
What pinned message?
Hsn
is there somthing wrong here that im missing ?
==== module_b.c ====
static char buffer[200];
char * pGetModuleBuffer(){
return buffer;
}
==== module_a.c ====
function_a(){
char *pWriteBuffer = pGetModuleBuffer();
snprintf(pWriteBuffer, 200, "text stuff %d", 123);
}
Hsn
klimi
and you include module b in module a?
Hsn
well im getting "implicit declaration" but that doesnt matter.
Hsn
linker is smart enough to find the fucntion
Hsn
meaning yeah .. i didnt do prototype of the function in module_b.h
Pulkit
Can anyone recommend me how to begin c++ like resources to learn and practice?
Talula
Pulkit
I'm a beginner
Talula
klimi
i mean i get that you are creating static hcar buffer... but it seems a bit wrong...
Pulkit
YouTube
Can you be a little more specific it's filled with many bad mentors too especially after the removal of dislike button
Hsn