and then use *scores, *(scores+1), *(scores+2) to print it. cool! :cool:
now I think the magic resides in the %s, and %c should be the same as %d.
if we pass %s to read and write functions,...
Type: Posts; User: yvan
and then use *scores, *(scores+1), *(scores+2) to print it. cool! :cool:
now I think the magic resides in the %s, and %c should be the same as %d.
if we pass %s to read and write functions,...
I know that and Alex explained that as well:
But my question is beyond that whereby I'm trying to understand how it works when using different things such as plaint scores, &scores, scores[x],...
Arrays in C - Cprogramming.com
I tried this with integers instead of string to try understanding what's happening internally.
#include <stdio.h>
how do you measure efficiency ? I'm not talking amount code but speed time those things.
--linesOfCode = ++abstraction
too much abstraction not good when you want to learn or when you make...
really ? you need recursion for example to solve some problems algorithmically or solve in more efficient way.
do all programming languages support that ?
very high-profile people you say ?
it's possible but why do they refuse to let it go?
you will have to rewrite many high-profile systems like OS kernels, web servers and even programming/scripting...
Suppose I do this:
printf("\n\t%c : %d %d", sptr[i], sptr, &sptr[i]);
the first %d prints the address of the first char in the string but why does that work without & or why is that no...
I wrote that program and compiled it. I see no addresses when I remove the &, but I figured it out.
It's 0x ascii value ! :cool:
when you remove the & in this line:
printf("\n\t%c : %p", sptr[i], sptr[i]); // sptr[i] and &sptr[i]
my source code:
#include <stdio.h>
#include <stdlib.h>
I think some more and different kind of technologies.
soms more: (x)html(5) with css for data representation and some client-side scripting with JavaScript when you want to do some validation...
C Tutorial - Learn C - Cprogramming.com
I was reading about XNU kernel which is written in C and C++, so I was wondering why not just C++ if it's more modern and efficient and object oriented,...
dear Matticus,
thank you for the answers and explanation but I get this feeling you are addressing me as if I am a developer of some real system/software, which is not the case because I am...
strlen() ! that is a good one.
I have another program
//an array of x cities whereby each city of y chars
int x = 3;
int y = 40;
char cities[x][y];
thank you
and yet, they say c is high level, it looks too low for me.
any good book or www on "undefined behavior" when doing c?
kr
now I see why some authors say you should use valgrind :wink:
now, I tried something, on linux and windows.
#include <stdio.h>
#include <string.h>
int main( int argc, char *argv[] ) {
I don't understand why this is working !
I'm a bit confused because there's no room free in my "str" when the size of an input is greater than 4 !
my code:
#include <stdio.h>
int main(...
dear Matticus,
thank you for the great comments. I updated the code, and I'm thinking now how and where to use some functions to reduce the size of main().
I removed +=3 cause it's "rsp" not...
https://upload.wikimedia.org/wikipedia/commons/thumb/6/67/Rock-paper-scissors.svg/2000px-Rock-paper-scissors.svg.png
14672
It is rock-paper-scissors game, of some sort ! :D
It is one player...
dear laserlight,
thank you! I see you are introducing new things to me, and I'm very glad with that.
I think I've found another approach. I will start with a "game" that emerges as I learn more C....
hi
my nephew encouraged me to take some c lessons and here I am with my questions his way :redface: and also with my first steps in learning the c, I have now this program which prints a name...