Thanks.
Type: Posts; User: DoK
Thanks.
I mean if I have :
char* str_temp;
str = "bla cla dla ela";
how can i copy the string from str 5-8 char to str_temp?
Thanks!
I usually do something like this:
int main(){
char choice;
while(1){
fputs("#Please select the exercise (1-5, 0 to exit): ",stdout);
choice = getchar();
...
You are the man :cool:
Thanks again!
Is it legit if add this function:
void clear_stdin(){
int c;
while((c = getchar()) != '\n' && c != EOF);
}
Actually it is still not working :/
This is the new code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void Ex1(){
Thanks:)
Thank you very much! :)
This doesn't work as well:
void main(){
char letter;
char* str;
fputs("Enter char:",stdout);
fgets(&letter,1,stdin);
fputs(&letter, stdout);
}
Hi,
Why this code works:
void main(){
char letter;
char* str;
printf("Enter char:");
fgets(&letter,2,stdin);
Thanks!
I did this:
int main(){
char taskNumberChar[4];
int taskNumberInt;
while(1){
printf("Please enter task number(1-2, 0 to exit): ");
Hi,
I need to get a sentence from a user and I have problem with that.
scanf - not works because I need to get the spaces.
gets - not secure and for some reason not working, it just skips...
I am aware that the code is far from perfect and I remember the "tips" that you gave me in my other thread.
Can you assist me with this one?
I don't know what you mean by high/low level functions. I will google it after I submit this home work. Thanks.
Thanks, I know that my code is a mess and somebody told me already about the malloc function, I will implement this next time that I write code.
For now I have to submit this to my teacher in two...
Hi,
I have this code:
#include <stdio.h>
#include <stdlib.h>
// mat1
#define col_size1 3
#define row_size1 2
I posted it separately because I have many other functions in this file, next time i'll post the full code.
You right I had to explain what is not working again, anyway sorry for my newbie...
Thank you WoodSTokk.
still not working :\
Hi,
I try to add some data to linked list and print it but it doesn't stop printing.. Can you assist please? :)
This is the code:
main:
void third_main(){
int** arr;
index_s*...
Thank you very much :)
Thanks!
I know that I am missing includes... This is just part of the code...
The "alloc_matrix" is working fine, this is the code of it:
int** alloc_matrix(int rows, int cols){
int**...
Hi,
I'm trying to make array of struct and I don't get where is my mistake.
can you help me please?
This is the code:
typedef struct{
int i_index;