What kind of function would I need to have to return a table that contains a string.
example:
int filltable(param eter){
char table[20] = {0};
return table[]
}
User Profile
Collapse
-
returning a char table (C)
-
qsort example please!
Hello!
Can someone give me a really simple example of qsort?
I just need it to sort an array that is 10 integers big.
I tried this:
http://www.phim.unibe. ch/comp_doc/c_manual/C/EXAMPLES/qsort1.c
but it gives me an error here at the qsort part.
Thanks in advance!!! -
Declaring a table with unknown size (C)
Hi everyone,
I need to declare an array of chars but I don't know how big it will be from the start of the program.
example:
Someone gives me a name:
John
Array gets filled with john
[j][o][h][n]
so the size of this array is 4 chars (not more)!
how can I declare an array that way?
I tried: char tablename[] but that doesn't seem to work.
... -
this is a function for a timer:
Code:void sleep(unsigned int mseconds){ clock_t goal = mseconds + clock(); while (goal > clock()); }
Code:printf("The program is now waiting 5 seconds and will start the program after"); sleep(5000) startprogram(); if (variable == 1){ printf("It started"); }else{ printf("It
-
Sound in C
Is there a way to have music playing in the background (from the program created in C) while running the program??
Thanks in advance!! -
Here you are then:
Code:#include <stdio.h> #include <stdlib.h> /*nodig voor random()*/ #include <time.h> /*gaat ermee voor zorgen dat niet telkens dezelfde getallen worden opgeroepen*/ #include <windows.h> int welkomtekst(void); int keuze1(void); int startspel(void); int moeilijkheidsgraad(void); int highscores(void); int eerstekeeropgestart =
Leave a comment:
-
well the program is kinda big and yes I typed:
#include <stdlib.h>
on top!Leave a comment:
-
sorry for double post but the 5 minutes expired:
I put the code I just put above ^^ in a switch case statement
so it would look like this:
switch(keuze){
case 1:
system("pathto. txtfile");
break;
case 2:
...
}
I guess that's totally wrong :D Can you specify how to do it a bit more? Thanks man you're being a great help!!!
...Leave a comment:
-
I put this:
system("C:\\Sch ool\\Gestructur eerd programmeren\\P rogrammeerproje ct\\Handleiding C.txt");
and it gave me this error:
linking error: undefined symbol _system in module simon.C
any thoughts?Leave a comment:
-
Thanks, but I actually meant opening the .txt file like when you would double click on it.
Sorry if I didn't explain well!
and do you know how to close the whole program? I tried abort() but that didn't gave me what I wanted!
thx already!!Leave a comment:
-
Opening and outputting a text file
Hi everyone,
I want to open a .txt file and just show it.Not for reading or anything but just showing it when people enter a certain number.
Can anyone tell me how to do this?
and is there a command to close all windows of the application?
IM DOING C++ IN BORLAND
No activity results to display
Show More
Leave a comment: