15,540 Topics

Member Avatar for
Member Avatar for jobra

Please can anyone help me to get the time zone between GMT & New York including the daylight saving. I am able to get the timezone between GMT & localtime including the daylight saving. My program goes like this [code=c] time_t t = time(0); struct tm* data; data = localtime(&t); …

Member Avatar for John A
0
229
Member Avatar for DynamitMsk

Hello, I'm trying to read in a txt file that looks like: AAAA BBBB 1234 CCCC DDDD 4321 .... and here's what I've done so far: [code] char a[4]; char b[4]; int c; FILE *input= fopen("input.txt", "r+"); if (input==NULL) perror ("Error opening file"); else{ while(feof(input)== 0){ fscanf(input,"%4s",a); fscanf(input,"%4s",b); fscanf(input,"%d",&c); } …

Member Avatar for Salem
0
2K
Member Avatar for himanjim

Hey friends , Is there any way to change textcolor in C? I am not able to find any method...

Member Avatar for himanjim
0
159
Member Avatar for p_p_g_1_6

[B]Here it goes: 1. Write a C program to calculate the value of x for the given formula of quadratic equation. 2. Write a C program to calculate the petroleum consumption. It should assign the distance travelled in km. and the amount of petroleum used in litres and compute the …

Member Avatar for DavidRyan
0
79
Member Avatar for manu124

Hi, Would really appreciate if someone can help me. Need to generate 10 random numbers such that their sum is less than 1. thanks so much in advance manu

Member Avatar for paradox814
0
156
Member Avatar for Kompot

:!: [U][COLOR=#000000]Minimum-weight Path.[/COLOR][/U] [COLOR=#000000] [/COLOR] [COLOR=#000000]An agent is required to move from the top row to the bottom row of a m × n grid, (i.e. from start position (0,j) 0<=j<n to end position (m - 1,j) 0<=j<n). On each move, the agent may only take one step rightward, diagonally …

Member Avatar for Lerner
0
95
Member Avatar for jvignacio

Hi guys, just wondering, how would i go about joining numbers together to form one integer.. example.. number 70 54 34 would end up being 705434.. thank u for your ideas...

Member Avatar for dubeyprateek
0
119
Member Avatar for himanjim

My header file time.h is being corrupted.. I can't find it on the internet... Can anyone please give me the link to the file or just copy and paste it to the reply of my paste...

Member Avatar for Narue
0
61
Member Avatar for Monsignor

OK, this is the problem: my original file has only one line and that line contains a sentence. I'm supposed to create a new file that will put each word from the sentence in its own line. For example, original file: [code=c]The quick fox jumped over the lazy dog[/code] output …

Member Avatar for Ancient Dragon
0
159
Member Avatar for Rooro

Hello everyone ... : ) i'm studying data structure and i'm trying to collect all the point in this course . what I have now is a question about sorting . I want to learn how can I do it and code it in the right way .. [quote] The …

Member Avatar for Rooro
0
106
Member Avatar for vicky_dev

I want to read a file which contains a list of integers. The first 4 bytes( or whatever sizeof(int) is ) indicates how many numbers the file has. Suppose I check the file size before reading so that I know I won't encounter EOF. Do I still need to check …

Member Avatar for Ancient Dragon
0
110
Member Avatar for mistermister

im trying to read a file has many lines but after reading it every time i tried to printf it, but it always print just the last line???/ f = fopen("text.txt","r"[IMG]http://www.free2code.net/plugins/forums/images/smilies/icon_wink.gif[/IMG]; if(!f) return 1; while(fgets(s,1000,f) != NULL) sprintf(value,s); fclose(f); printf("%s",value); [URL="http://www.free2code.net/plugins/forums/reply.php?f=3&p=48130&q=48130"] [/URL]

Member Avatar for mistermister
0
113
Member Avatar for lastcraft

Hi... I'm trying to get a few people to try out a new C unit tester called Cgreen. It's published on Sourceforge at [URL]http://sourceforge.net/projects/cgreen/[/URL] and at [URL]http://www.lastcraft.com/cgreen.php[/URL]. basically I'm after feedback before pushing for a stable release. It's currently a late alpha. Besides the usual X-unit features (setup/teardown, composite suites), …

0
64
Member Avatar for omlaka

Hi All,As usual. I am a silent member until I have passed my exam. Recently, I passed my exam with 95% for 1Z0-042. Meaning 95% of the questions are from certmagic.com guide. There a few new questions, which I am not familiar with. These questions would be remaining 5% of …

Member Avatar for Dani
0
95
Member Avatar for centrinostyle

hello my name is asif i want simple c program of transpose of matrix plz help me

Member Avatar for DavidB
0
93
Member Avatar for JoBe

Hi guys, This exercise goes as follows: - Write a function that counts the number of occurences of a pair of letters in a string and another that does the same in a zero-terminated array of char(a C-style string). For example, the pair "ab" appears twice in "xabaacbaxabb". Now, I …

Member Avatar for Dave Sinkula
0
367
Member Avatar for Colin Mac

Here's an example of two programs that do the same thing, I have been taught how to do them like the first way. Now, I'm reading an ebook and it explains to do them like the second way. Which way do you think is more proper? thanks [code]#include <stdio.h> int …

Member Avatar for Colin Mac
0
98
Member Avatar for newbie2c++

Hi Everyone! I am supposed to be writting a program that will run from the web. I created a short program to see if I could use linux by uploading the file to my public_html and then using putty to change it to a .cgi file but nothing is working. …

Member Avatar for Ancient Dragon
0
81
Member Avatar for Marks256

Ok, i am just starting out in C. This isn't my first programming language, though(i don't mean to brag, but i am a BASIC master), so i know quite a bit about computer architecture, and all that good stuff. The project i am designing is a robot with stereo vision. …

Member Avatar for Salem
0
162
Member Avatar for hugoboss2

[COLOR=#000000]in language C [/COLOR] [COLOR=#000000]Code that examine if the tree is full[/COLOR] [COLOR=#000000]Tree is full if each node have 2 child[/COLOR] [COLOR=#000000]i dont know how to write the code ?[/COLOR] [COLOR=#000000]somebody can help me ?[/COLOR]

Member Avatar for WaltP
0
78
Member Avatar for skeet123

Having trouble where to go next on this program: 1. If n is even, then you may give back exactly n/2 bears. 2. If n is divisible by 3 or 4, then you may multiply the last two digits of n and give back this many bears. By the way, …

Member Avatar for Narue
0
341
Member Avatar for lavicool

Hi All, Thanks for all your help and advise. Here is a code for printing sales record. I don't understand what is the error in this code. When I try to complie and run, it says it cannot open the "sper.dat" file. Please help. Here is the 2 input files …

Member Avatar for ~s.o.s~
0
121
Member Avatar for drake_bower

can any1 please help me about dijkstra's shortest path algorithm.

Member Avatar for Infarction
0
50
Member Avatar for caltiger

hi, I wanted to know if I can pass functions with varying no. of arguments to a fn pointer. say for example, i define a fn pointer as void (*fptr)(const void* , const void*); If there are another pair of fucntions defined as : void f1(int*, int* ); void f2(int*, …

Member Avatar for caltiger
0
143
Member Avatar for shadowmoon

how can i get a program to include other cpp files?? like if i was on a tem for school and we spilt the work into smaall parts ca we just use ome kind of include function to put all the files together withotu copy-pasting:????

Member Avatar for jim mcnamara
0
149
Member Avatar for iubike

Well the program takes a string of text and then turns it into title case (first letter or every word is capitalized). So I got it working as you see, the problem is I need to write a seperate function that can simply accept the string to be converted as …

Member Avatar for Narue
0
140
Member Avatar for whitemoss

Hi guys, need ur help regarding the above matter. I've write a code for if statement but it didnt work as expected when I run the program. Below is my code: [code] // Get ChannelID strcpy(src, row[11]); if (strcmp (src, "1") == 0) { if (sprintf(query2, "select * from Register …

Member Avatar for whitemoss
0
115
Member Avatar for Sanchez10

Anyone have any ideas on how to simulate an I/O device such as an MP3 player serially?

0
69
Member Avatar for clevername

I need to use RNG to create a sentence, I know how to use a RNG to create numbers from 0-x but im not sure on how to use it to create sentences. Is there a way to assign random numbers to characters and store them into an array to …

Member Avatar for jaguar founder
0
69
Member Avatar for FireSBurnsmuP

Just what I need. In the midst of the two busiest weeks of the semester, and I get a friggin run-time error. I am running 64-bit Debian etch, and running the program from a terminal. It gets to some perfectly good code (I've said that before, and I was wrong), …

Member Avatar for FireSBurnsmuP
0
106

The End.