text editor
man... ppl are so lazy to google these days...
Type: Posts; User: yxunomei
text editor
man... ppl are so lazy to google these days...
try this
#include <stdio.h>
int functionA(int x) {
return x * 2;
}
int functionB(int y) {
return functionA(y) * 2;
i've done this in C... searching for modus of given data, here's the reference implementation
[~/MISC/C] ./a.out
1 3 4 3 3 4 5 6 3 2 3 4 3 4 5
The mode is 3
[~/MISC/C] ./a.out
3 3 3 3 3 4 4 4 4...
then i believe the proper question should be "what's bad if i run that code"
lol... just what I expected ;)
ok, here's the calloc version
char *s;
s = calloc(array_size, size_of_var_type); // in your case : calloc(10, 1)
return 0;
yes you can do that
char *s;
if((s = (char *) malloc(size_you_need)) == NULL) {
fprintf(STDERR, "not enough memory\n");
exit(0);
}
this thing
double averageFunc(int integerVariable[], int noOfArray)
{
for (int i = 0; i < noOfArray; i++)
{
allNumbers = allNumbers + integerVariable[i]; // initialize...
it will malloc, in a sense that the OS will try and allocate memory block for your array... you can't check it by yourself... unless if you are talking about dynamic data structure
>Problem about how to choose ?Multi(or 2+ more file)-file to output from File >Data O/I in C programming.
>Thank[b]'s!
typos?
fopen, fscanf
the thread you went was talking about C... i know only a bit of C++, been using C, tho the syntax is almost the same... but I don't know atoi equivalent for C++
it should be <iostream> (without...
have you compiled and see it yourself? tho i saw some problems with your struct definition
int x[10];
for (int i = 0; i<10; i++)
{ while(cin >> x[i]) // no need to loop, just a single cin
{ // not neccessary
cout << x << "\n";
} // not neccessary
ah ic... sorry, was my first C++ program.. been using C :D
you might find this interesting, tho i'm using int
#include <iostream>
using namespace std;
int main() {
int i;
>I have a bunch of variables declared at the top of my main function. Is there a way I can call a function without creating a mess like the one below?
yes you can, by making the required...
what have you done so far? use fopen if you want to open the file, put the content into a buffer, and save it per 30000 byte using loop....
that's if you want the hint...
rite... u have to put spaces "1 0 1 1 0"
void run (char cur[])
{
char *param[MAX]; // this is like saying,
// I want to have a pointer to a string
// are you sure you know what you are doing?...
place everything from the map file into a 2 D arrays and whenever you want to put the player relating to the screen, say (15, 5)
do something like
mapStuff[15][5] = 'X' // suppose we use 'X' to...
does that even compile?
I don't know, but I find my OS to be VERY interactive...
Everyone here has the intention of giving them their idea... If you find their way of expressing their thought a bit offending... then I'd...
is this what they call de javu?
i did this
#include<stdio.h>
int main() {
char s[10];
fgets(s, 10, stdin);
int a;
int b;
> The issue I have is that sample0 is a structure of memory and I don’t know how to point it to sampleX where X is a variable number in a loop and have it work.
structure of memory? do you mean...
alrite2, don't get angry now... :D here's wat i got from localtime manual page
NAME
asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r, localtime_r - transform...