Posts
 
Reputation
Joined
Last Seen
Ranked #762
Strength to Increase Rep
+2
Strength to Decrease Rep
-0
50% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
2 Commented Posts
0 Endorsements
Ranked #2K
~41.8K People Reached
Favorite Forums
Favorite Tags
Member Avatar for darkbreaker

I am developing a network chat application, I am using Winapi, my main window is a dialog (created from a .rc file). I am looking into a way of doing an text box where my outuput text can be like this: [QUOTE] [COLOR="Green"]Welcome to ##### chat server![/COLOR] [COLOR="Red"]Person1[/COLOR] says: Hi …

Member Avatar for darkbreaker
0
272
Member Avatar for peck3277

Just to clarify, Sleep() takes milliseconds as argument, so the number for 10 minutes would be 1000*60*10.

Member Avatar for darkbreaker
0
72
Member Avatar for jeremy62

Or you could try something like this: [CODE]#include <stdio.h> #include <stdlib.h> int main(void){ while(1){ system("cls"); int opc; bool process=false; printf("Select an option:\n"); printf("1. Option A:\n"); printf("2. Option B:\n"); printf("Option: "); scanf("%d",&opc); if(opc > 0 && opc < 3) process=true; if(process){ //do something printf("\n\nDOING SOMETHING!"); }//else let it go back to …

Member Avatar for Shankye
0
258
Member Avatar for jeremy62

I know i shouldn't do this... but this is the code you want: [CODE]#include<stdio.h> #include<stdlib.h> #define ARRSIZE 9 int main(void) { int arr[ARRSIZE],i,sum=0; float average; for(i = 0; i < ARRSIZE; i++){ printf("(%d/%d) Input a number: ",i+1,ARRSIZE); scanf("%d",&arr[i]); sum += arr[i]; } average = sum / ARRSIZE; printf("\nThe average is …

Member Avatar for darkbreaker
0
152
Member Avatar for frankchester

[QUOTE=frankchester;1401878]Hi everyone, thanks for your replies so far. I've managed to get a working piece of code using the examples given, however I've run into a problem. Here is the code: (...) The problem is that fscanf doesn't like spaces, so it sees the sentence I have and only stores …

Member Avatar for frankchester
1
38K
Member Avatar for arineon

[QUOTE=Ancient Dragon;1399562]Or to avoid costly addition operations [code] for (j = 0; pTemp[j] != '\0'; j++,i++) pWord[i] = pTemp[j]; pWord[i] = '\0'; [/code][/QUOTE] And to clarify, if you do this you should initialize i as 0 or it will hold random numbers.

Member Avatar for darkbreaker
0
148
Member Avatar for becka221

[QUOTE=becka221;1397507]I fully understand the above code now... after much perserverance. Thankyou :) Does this now mean i can use input = fopen("fname", "r"); and it will open each .txt file in order?[/QUOTE] Yep, but without the quotes around [B]fname[/B] as it is a variable name not a string itself. [CODE]input …

Member Avatar for vinitmittal2008
0
149
Member Avatar for fussballer

[QUOTE=WaltP;1397830]You have to specify a value, not a variable, when defining an array: [CODE] double x[16][2];[/CODE][/QUOTE] Yep, and that's because arrays are set at compile time, not run time. Although you can use define macros for this: [CODE]#include <stdio.h> #define ARRSIZE 16 int main(void) { int var[ARRSIZE]; // (...) }[/CODE]

Member Avatar for mitrmkar
0
241
Member Avatar for arineon

[QUOTE=arineon;1397670]I have a project to have a file read using argc and argv. Then sort it and do some other things. I'm having trouble with the very first step. Loading the file. This is what I have so far. Any help you be great. <snip> [/QUOTE] Do you mean this? …

Member Avatar for WaltP
0
2K
Member Avatar for aznelite89

[B]fscanf[/B] stops reading a string when it finds a whitespace, so you should ensure you dont have spaces in the string or use another character instead (_). [CODE]void List_Student_Details() { int n=0; // <----------------- (...) &details[n].studno, &details[n].regno.year, &details[n].regno.campus, &details[n].regno.level, details[n].regno.sn, details[n].surname, details[n].givenname, &details[n].gender, details[n].fathername, details[n].addr1, details[n].addr2, details[n].addr3)!=EOF) (...) n++; } …

Member Avatar for darkbreaker
0
137
Member Avatar for darkbreaker

I wrote a function in C that receives a pointer to a character array as argument and switch all accented letters with their corresponding character, the code is as follows: [CODE]void removeacc(char *texto){ char a[]="\x83\x84\x85\x86\xa0\xc6",A[]="\x8e\x8f\xb5\xb6\xb7\xc7"; char e[]="\x88\x89\x8a\x82",E[]="\x90\xd2\xd3\xd4"; char i[]="\x8b\x8c\x8d\xa1",I[]="\xd6\xd7\xd8\xde"; char o[]="\x93\x94\x95\xa2\xe4",O[]="\x99\xe0\xe2\xe3\xe5"; char u[]="\x81\x96\x97\xa3",U[]="\x9a\xe9\xea\xeb"; char n[]="\xa4",N[]="\xa5"; char c[]="\x87",C[]="\x80"; char y[]="\x98\xec",Y[]="\xed"; int …

Member Avatar for darkbreaker
0
137
Member Avatar for rinjin07

Wel, I know [B]Portugol[/B]. Portugol is just a pseudo-code language used to teach programming logic to students that speak the Portuguese language. (I hate it btw...) It was never meant to be a real programming language until someone created a compiler for it. (The language itself is not useful besides …

Member Avatar for darkbreaker
0
102
Member Avatar for maggie_fairy

[CODE]while(getchar() != '\n'); // ? if (decOrEnc == 1) encrypt(shift); else { shift = -1 * shift; encrypt(shift); } return 0; }[/CODE] While should have a "{" symbol at the end not a ";". [CODE]void encrypt(int shift) { char ch; printf("Please enter a string: "); ch = getchar(); while(ch != …

Member Avatar for darkbreaker
0
309
Member Avatar for Futchy

[QUOTE=T1205;1387882]In c++, create a structure that holds fields for employee name (character array max length of 50), the social security number (an integer), and the payrate (floating point). (...) +4 posts..[/QUOTE] Use the edit button instead of making various posts this can be considered flooding. @Futchy Like prevoius posters said, …

Member Avatar for darkbreaker
0
400