15,550 Topics

Member Avatar for
Member Avatar for skiabox

I am trying to produce a random walk solution but I get some strange results. Here's the code : [CODE] #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <time.h> int main (int argc, const char * argv[]) { // insert code here... char myArray[10][10]; char letters[26] = {'A', 'B', 'C', 'D', …

Member Avatar for WaltP
0
150
Member Avatar for DerLars

Hello everybody, I have spend the last 6 hours on trying to access a char * type within a static struct without success. I guess I use the pointers wrong but after trying "everything" I am pretty lost right now. So hopefuly someone of you can help me. I have …

Member Avatar for gerard4143
0
139
Member Avatar for Goshutu

my program is made to enter a matix,in which it finds all of the column`s minimum numbers which are[COLOR="Red"] >0[/COLOR] and then put them under the last row.i have sucseded entering the array and puting it out,but i think my IF is wrong somehow.I have tried initialising the last row …

Member Avatar for Goshutu
0
197
Member Avatar for coolshiva

hi everyone i need some example programs on UART in embedded c for atmega8 micro controller can anyone help me plzzzzzzz

0
135
Member Avatar for Rajdarji

[CODE]#include <stdio.h> #include <ctype.h> #include <string.h> #include <unistd.h> #include <libgen.h> #include <time.h> #include <errno.h> #include <ctype.h> #include <math.h> #include <float.h> #include <stdlib.h> static char * string_tok( char *str) { static char *next = NULL; if(str == NULL) { str = next; } else { next = str; } if(str == …

Member Avatar for invisal
0
124
Member Avatar for onus

I have used typedef in my C programs previously many times. So it is not new to me. I was reading through a header file linux-2.6/include/net/iw_handler.h and found following use of typedef [CODE=c]typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra); [/CODE]I was not able to …

Member Avatar for mitrmkar
0
112
Member Avatar for MK1985

Hi, I am using win2000 Operating system and using microsoft visual studio to develop my application and while running i am getting debug assertion failed error.

Member Avatar for Adak
0
34
Member Avatar for Tellalca

How is it possible to delete a byte ( char, int, double .. ) from a text file ? Suppose that the file.txt contains :"110Hello". And I want to delete "110" from the file leaving only the "Hello" part. How to do this without reading the whole file into the …

Member Avatar for WaltP
0
72
Member Avatar for littleCuteMaria

I am working on a control break algorithm in C, and part of this algorithm is to have while loop check for the end of file and whether two strings equal each other. the first string is a part of a typedef struct structure called 'record' [I]rec.state[/I], and the second …

Member Avatar for Ancient Dragon
0
121
Member Avatar for widapol

Hi all, I want to send a file to my gmail over socket. Reading a file and writing it to socket is simple but actually I donot know how to implement SMTP over socket. Could anyone tell me how to do it ?

Member Avatar for group256
0
94
Member Avatar for suma k
Member Avatar for poojabi

between merge sort and binary insertion sort which is more efficient?i know that theoritically both are nlogn search bt practically which will be better.that means if we plot the graph of number of comparison vs number of element in the list hose slope wll be slightly more than the other.and …

Member Avatar for Adak
0
624
Member Avatar for jack223

It's from my homework assignment Question 1) Based on the O notation, approximately how many swaps and comparisons occur when Selection sort is called on a worst-case array of length 8? a) 16 b) 64 c) 100 d) 800 Number of swaps = O(n) which is "8" and Number of …

Member Avatar for Adak
0
148
Member Avatar for Micko

Hello, I'm playing with win API functions readFile and WriteFile. Is it possible to open file using CreateFile in binary mode just like using fopen standard C function. I tried with function WriteFile to write string to a file but it seems that file is opened in textual mode. What …

Member Avatar for progneer.soft
0
8K
Member Avatar for ybsolar

I want to create a double pointer and make it point to an double dimension array, then output the content of the array through the pointer. However Gcc warn me that "assignment from incompatible pointer type". Just like this: [CODE]#include <stdio.h> #include <stdlib.h> int main() { int i,j; int **p; …

Member Avatar for gerard4143
0
134
Member Avatar for lais90

I wish to change the color of my printf statement. I use following code: [code]#include <stdio.h> #include <stdlib.h> void main() { system("color e"); printf("An enemy appears\n"); system("color c"); printf("This is an apple.\n"); }[/code] I wish to print the statement which is "An enemy appears" in yellow color and "This is …

Member Avatar for mitrmkar
0
706
Member Avatar for myk45

Hello, i have 2 small doubts regarding pointers. 1)im trying to defererence 4 bytes as shown, and im initializiing each byte using a char pointer. But im getting runtime errors. Code [CODE] char a = 65; char *ptr = (char *)malloc(4); int *ptr1; ptr = &a; ptr1 = &a; *ptr …

Member Avatar for myk45
0
221
Member Avatar for suma k
Member Avatar for creeps

This one is pretty strange (or at least I can't figure out what triggers it). I have the piece of code below, but there seems to be a bug with the second call of [icode]scanf[/icode]. It simply gets skipped. So the input should be something like [code] 10 3 fbfbfbfbfb …

Member Avatar for creeps
0
101
Member Avatar for Naveen

hi can any1 send me the source code to the bellman-ford and djikstra routing algos please? regards, naveen.

Member Avatar for byomakesh mahap
0
135
Member Avatar for moufoo

Hello, It's been a few months since I haven't been able to launch Codeblock's debugger, when I launch the debugger I always get this (example): [B]Adding source dir: C:\Users\Me\Desktop\L2\SDD\TP2\ Adding file: bin\Debug\TP2.exe Starting debugger: failed[/B] I have tried: [LIST] [*]Reinstalling [*]Reinstalling (uninstall done using Revo Uninstaller) [*]Installing latest version of …

Member Avatar for Ancient Dragon
0
733
Member Avatar for Masas

So I got this assignment to combine two arrays without using strcat(). The two arrays must be passed to function as parameters. The arrays need to be merged into one array in the function with dynamic memory allocation and then the new string needs to be returned back to main. …

Member Avatar for savdapu krishna
0
281
Member Avatar for subclass

I'm attempting to solve this for myself as this is homework but I can't get past the hurdle. I have an array that dynamically holds the pixels of an image (chars) in its second dimension (first being the image number). I first initialize my array variable... [CODE] unsigned char** imgSet; …

Member Avatar for subclass
0
231
Member Avatar for emmas4impact

Am trying to write a program that read some question and answer in a text file and after displaying it in another text file and i want to make use of [COLOR="Red"]struct[/COLOR] in my program. How do i go about it using rand() to generate the question. Anyone one with …

Member Avatar for Adak
0
96
Member Avatar for atramposch

Heres the assignment. 1. Declare a string, e.g. char str[81]; 2. Input a string from the keyboard (spaces included) using the (while statement while( while (str[i] = getchar() != '\n' ) adjusted so that it only inputs a certain number of characters ( in the above example that would be …

Member Avatar for gerard4143
0
148
Member Avatar for howzat

Would anybody be able to transform the following C code that uses while loops into C code that uses goto loops [code]while(i<10) { i++; j=0; while(j<i){ j++; printf("*"); } printf("\n"); }[/code]

Member Avatar for WaltP
-1
30
Member Avatar for Shift-Stop

[code=c] // ----------------------------------------------- mySquare( y1) // rcv'ing dbl = 4 { double x1=1 ;// valid, but impossible to reach. printf("\n SQRD incoming Y1: %d",y1); // shows 4 printf("\n SQRD return y1*y1: %d",y1*y1); //shows 16 x1 = (y1*y1); // ??? printf("\n SQRD return X1: %d",x1); //shows 0 ! return x1; // …

Member Avatar for Shift-Stop
0
85
Member Avatar for joydsouza90

how do you fill an object such as a rectangle with a colour using setfillstyle(); ?? I dont want to use flood fill as i am having more problems with that..

Member Avatar for 007himanshujain
0
73
Member Avatar for Vininski

Having a problem with assigning a string in this linked list, any ideas? the line that reports an error is highlighted in red. I would expect this to work as variable 'name' is a char array and i am simply assigning the string "Vin" to it. [CODE]#include<stdlib.h> #include<stdio.h> typedef struct …

Member Avatar for Vininski
0
249
Member Avatar for SHENGTON

Hello, good afternoon. :) Now I got some problems with my "Create Payroll". I changed the "rate[100]" integer to "salrate[100]" float. After changing these errors prompted me. [b]Errors:[/b] payroll system.cpp(157,22): Illegal use of pointer <-- This is "Error" payroll system.cpp(158,8): Possible use of 'gsalary' before definition <-- This is "Warning" …

Member Avatar for Ancient Dragon
0
172

The End.